Hi Peter,
thank you very much for your quick reply. Indeed, the example does work with 
the fixed offset.
Although it's a minor issue, you might consider fixing the example in the Ruta 
documentation.

It was confusing, that even the simple example from the documentation didn't 
work, 
while examine a problem in our application using the string function from the 
ruta extension jar.
Thank you again.

Best regard,
        Wolf-Dietrich Materna

-----Ursprüngliche Nachricht-----
Von: Peter Klügl [mailto:[email protected]] 
Gesendet: Dienstag, 17. November 2015 09:24
An: [email protected]
Betreff: Re: How to use string functions from ruta-core-ext in Ruta

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.ru
> ta.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