Hi,

it should work just fine (tested with current trunk).

The substring function like the other string functions just delegate to
the java methods. Thus,  the substring from 0 to 8 returns "Alexande".
The example should work with : CW{-> MATCHEDTEXT(s), ADD(sl,
substring(s,0,9))};

Best,

Peter

Am 17.11.2015 um 09:05 schrieb Wolf-Dietrich Materna:
> Hi,
>
> I'd like to use the Ruta string functions referenced in the user guide here: 
> https://uima.apache.org/d/ruta-2.3.0/tools.ruta.book.html#ugr.tools.ruta.language.extensions.core-ext.stringfunctions
>
> The problem is, they don't work out of the box in the Ruta Workbench 2.3.1 
> with Eclipse 4.4.2. I've set up a new Ruta project with a script containing 
> the (slightly modified) code from the substring example:
>
> DECLARE Test; // I've added this line to make the example work.
> STRING s;
> STRINGLIST sl;
> CW{-> MATCHEDTEXT(s), ADD(sl, substring(s,0,8))};
> CW{INLIST(sl) -> Test}; // Changed SW to CW to make the rule work.
>
> The input file only contains two words, "Alexanderplatz" and "Alexander". 
> What I expected was that the first rule finds "Alexanderplatz" and stores the 
>  first nine letters of it in the string list sl so that the last line can 
> annotate "Alexander" with "Test". In reality, however, nothing happens. I get 
> no error message, but after execution, there is no "Test" annotation.
>
> Is there some additional configuration needed to access these string 
> functions?
>
> Any help would be appreciated.
>
> Best Regards,
>             Wolf-Dietrich Materna
>
>

Reply via email to