2015-04-29 19:38 GMT+02:00 Andriy Rysin <ary...@gmail.com>:
> I just found out that if I have multiple tokens with min="0" my
> patterns don't match. Looking at the code it seems like if min="0" we
> only check for next pattern to match but that next may also have 0
> mins.
> I wrote little patch with tests that make my rules work but
> unfortunately it breaks 1 rule in Catalan (where two consequitive min
> 0s are used). All other languages tests pass.
>
> I would appreciate if somebody can take a look at the patch in general
> and also why it breaks ca rule.
>
This is the rule:
<rule>
<pattern>
<token inflected="yes">hi</token>
<token postag="V.[MSI].*" postag_regexp="yes"/>
<token min="0" postag="V.[NP].*" postag_regexp="yes"/>
<token min="0" inflected="yes">de</token>
<token postag="V.[NG].*" postag_regexp="yes"/>
<token regexp="yes">[-']hi</token>
</pattern>
<message>Pronom feble duplicat.</message>
<example correction=""><marker>Hi vam haver
d'anar-hi</marker>.</example>
<example correction=""><marker>Hi hem hagut
d'anar-hi</marker>.</example>
<example>Vam haver d'anar-hi.</example>
</rule>
The problem, I think, is that there is an ambiguity because a word with
postag="VMN000" ("haver") can match token number 3 and token number 5 (if
both tokens with min="0" are skipped). In the first example it should match
token 3, but it matches token 5 and the whole pattern doesn't match.
If the bug can't be fixed, I can write the rule in some other way easily.
That's not a problem
Regards,
Jaume
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel