Hi, 

thank you for your quick reply. 
The feature wordLemma is a String. 

The alternatives you wrote work out. Thanks.  

Nevertheless, will there be the possibility to work on features in a block 
statement in the future? (For other use cases) 
Or is the block statement not needed at all? 
I used it because I found it in the user guideline in relation to NER-task:

STRING s;
BOOLEAN a ;
BLOCK(forEACH) W{}{
    W{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
    W{a ->Test};
}
So, what's the advantage of the block statement here? 


And one other question: 
We implemented Ruta into the UIMA pipeline, but in the debug mode, the ruta 
views "matched rules", "applied rules", "failed rules" etc. are all empty. 
How can we fix this? 

Best regards, 
Lisa 





 


----- Original Message -----
From: "Peter Klügl" <[email protected]>
To: "user" <[email protected]>
Sent: Tuesday, May 30, 2017 3:55:41 PM
Subject: Re: UIMA Ruta use of features in a block statement

Hi,


yes, this should throw an error when the script is parsed. I have to
take closer look, could be that the feature is interpreted as literal
string matching condition because of a string expression representing
the feature.


What is the range of the feature wordLemma? Support in ruta for
StringArray and StringList is still not really given.


If you want to iterate, you need to iterate over annotations currently.
The rules also operate always on types or annotations, something that is
a reference to some text position. However, this should not be a problem
as you can simply use the existing Lemma annotation.


You could try something like:


FOREACH(lemma) Lemma{}{
    lemma{REGEXP(lemma.wordLemma, ".*vergess.*") -> Value2};
}


or even



l:Lemma{REGEXP(l.wordLemma, ".*vergess.*") -> Value2};


with the boolean string function, it could work like this:


l:Lemma{contains(l.wordLemma, "vergess") -> Value2};


(I did not test the rules and I was assuming several things like feature
ranges)


Best,


Peter


Am 30.05.2017 um 15:35 schrieb Lisa Langnickel:
> Hi, 
>
> I would like to use a BLOCK statement to iterate over the values of a feature.
> In more detail, I applied a lemmatizer before and would like to work on the 
> "lemmas" itself.
>
> I tried something like this (where Lemma.wordLemma describes the feature of 
> Lemma):
>
> BLOCK(forEACH) Lemma.wordLemma{}{
>     Document{-> MATCHEDTEXT(s), ASSIGN(a,contains(s,"vergess"))};
>     Document{a -> Value2};
> }
>
> There is no error message, but nothing happens. Instead, when only working on 
> the type "Lemma", it works. 
>
> Is there any possibility to work on the feature within the block statement? 
>
> Thanks in advance, 
> Lisa

Reply via email to