Hi,
we have min and max attributes now. Quoting the change log:
-Rule syntax: new min/max attributes allow to match an element that
appears
the given number of times. For example:
<token min="0">foo</token> will match nothing or "foo", i.e. "foo"
is optional
<token max="2">foo</token> will match "foo" or "foo foo"
<token min="0" max="2">foo</token> will match nothing, "foo", or
"foo foo"
Use max="-1" to allow unlimited occurrences.
For min, only 0 or 1 is supported (1 is the default).
This was also supposed to be a replacement for skip, so that <token
min="0" max="2"/> will match 0, 1, or 2 tokens, but that doesn't work
yet.
The code is in PatternRuleMatcher.match(), just in case you want to
look at some really incomprehensible nested loops.
Regards
Daniel
--
http://www.danielnaber.de
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Languagetool-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-devel