Hi,

I haven't tested the rule for bugs yet , so here's just a comment for now.

The order of evaluation of the conditions is fixed. The usage of conditions on a wildcard can lead to unexpected matches (and it can considerbaly decrease the runtime performance).

There is a difference between a wildcard and a reluctant quantfier like "ANY+?".

The wildcard takes a look at the next rule element and then evaluates its conditons. If a condition fails, the next rule element is consulted again, like moving forward on its iterator, and then the conditions are checked again. With a normal matching rule, the conditions are directly evaluated and the next element is not considered anew or skipped.


I have to test the rule in order to give you a specific answer, but that will take some time (I am a bit busy right now)


Best,


Peter


Am 11.08.2017 um 22:23 schrieb Tom Vacek:
Assume I have made PositiveContext and NegativeContext annotations from a
word list.   I would like a wildcard rule that allows any number of
PositiveContext tokens, some (eg 4) unknown tokens, but no NegativeContext
tokens.
I have this rule:
INT contextCount;
(Keyword1  #{COUNT(PositiveContext,0,100,contextCount),
CONTAINS(W,0,contextCount+4), -CONTAINS(NegativeContext)} Keyword2
The rule behaves unpredictably, perhaps as if the order of evaluation of
the conditions is not fixed.  Is this the case?  Or is it some other bug?

Thanks,

Tom


Reply via email to