[
https://issues.apache.org/jira/browse/UIMA-4062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14188813#comment-14188813
]
Silvestre Losada Alonso commented on UIMA-4062:
-----------------------------------------------
I already implemented a solution that takes RutaTable impoementation from uima
exernal resources. A external resource is defined
{code:xml}
<externalResourceDependencies>
<externalResourceDependency>
<key>presidentsCsv</key>
<description/>
<interfaceName>org.apache.uima.ruta.resource.RutaTable</interfaceName>
<optional>false</optional>
</externalResourceDependency>
</externalResourceDependencies>
<resourceManagerConfiguration>
<externalResources>
<externalResource>
<name>csvPresidents</name>
<description/>
<fileResourceSpecifier>
<fileUrl>file:/home/slosada/desarrollo/proyectos//UIMA-dev/script/presidentsOfUSA.csv</fileUrl>
</fileResourceSpecifier>
<implementationName>com.mycode.example.uima.datatable.CSVTable</implementationName>
</externalResource>
</externalResources>
<externalResourceBindings>
<externalResourceBinding>
<key>presidentsCsv</key>
<resourceName>csvPresidents</resourceName>
</externalResourceBinding>
</externalResourceBindings>
</resourceManagerConfiguration>
{code}
In ruta script can be used in following way.
{code}
WORDTABLE presidentsOfUSA = 'presidentsCsv';
DECLARE Annotation PresidentOfUSA(STRING party, INT yearOfInauguration);
Document{->MARKTABLE(PresidentOfUSA, 1,presidentsOfUSA, "party" = 2,
"yearOfInauguration" = 3)};
{code}
If this the implementation is ok for you, I can create unit test for this
fuctionallity (I'll need some help to see where I can place them) and can
submit the patch.
> Plugable external resources on UIMA RUTA
> ----------------------------------------
>
> Key: UIMA-4062
> URL: https://issues.apache.org/jira/browse/UIMA-4062
> Project: UIMA
> Issue Type: Improvement
> Components: ruta
> Affects Versions: 2.2.1ruta
> Reporter: Silvestre Losada Alonso
> Assignee: Peter Klügl
> Labels: enhancement, uima
> Fix For: 2.2.2ruta
>
>
> Currently UIMA ruta has WORDLIST and WORDTABLE, it is a list or table of text
> items that can used to detect occurrences. This is nice feature and very
> powerfull, however there is no way to plug my own WORDLIST/WORDTABLE
> implementation, for example WORDLIST that find matches in database table or
> in lucene index etc...
> I think that the WORDLIST/WORTABLE implementation can be defined as UIMA
> external resource, in resources section, and then pass a reference to
> WORDLIST/WORDTABLE in ruta script. The other option is to specify the class
> that implements WORDLIST/WORDTABLE to RutaEnvionment and instantiate it in
> ruta environment using Reflection.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)