uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Kl├╝gl <pklu...@uni-wuerzburg.de>
Subject Re: TextMarker rules and regexp
Date Mon, 08 Apr 2013 12:30:40 GMT

Am 05.04.2013 09:23, schrieb Laurent Audibert:
> Hi all and thanks for the good job on TextMarker.
> I would like to write a rule using a FEATURE condition that compares a 
> feature of the matched annotation with a REGEXP as second argument.
> For example, rather than :
> Lemma{FEATURE("lemma","human")};
> I would like to write something like that :
> Lemma{FEATURE("lemma",REGEXP(".*human.*"))};
> Is there a way to do that with TextMarker language ?

There is a way, but it is not as nice as it should be.

You can use REGEXP with string variables and you can store the string 
feature value in variable, but the variables are global and would be 
overridden for each rule apply. This is because there is no condition, 
which is able to assign the feature value to a variable.

So, you would need something nested (I haven't tested it right now):

BLOCK(ForEach) Lemma{}{
     Lemma{-> GETFEATURE("lemma", val)};
     Lemma{REGEXP(val, ".*human.*")};

I am actually planning to introduce something like a "field"-notation, 
so that working with features will become less cumbersome. It would look 
like: Lemma{REGEXP(Lemma.lemma, ".*human.*")};



View raw message