W dniu 2014-03-22 14:35, Dave Pawson pisze:
> Looking at an English language book I have
> bear vs bare.
> <!-- this is an example rule: -->
> <rule id="CONFUSION_OF_BARE_BEAR" name="confusion of bare/bear">
>      <pattern>
>          <token>bare</token>
>
>      </pattern>
>      <message>Did you mean <suggestion>bare</suggestion>?</message>
>      <example type="incorrect">You have <marker>bear</marker> feet.</example>
>      <example type="correct">You have bare feet.</example>
> </rule>
>
> I'd like to say <token>bare</token>
> followed by any noun?

<token>bare</token>
<token postag="NN.*" postag_regexp="yes"/>

(note this might be slightly unsafe as we don't have a strong 
disambiguator so some words tagged as nouns could be verbs or adjectives).

>
> I'm getting an error


Well, you said you expect "bare" but your incorrect example has "bear". 
No wonder you get no match.


>
> There are problems with your rule:
>
> The rule did not find the expected error in 'You have bear feet.'
> The sentence was analyzed like this:
> <S> You[you/PRP,B-NP-singular|E-NP-singular] have[have/VB,B-VP]
> bear[bear/NN:UN,bear/NNS,B-NP-plural]
> feet[foot/NNS,E-NP-plural].[./.,</S>,O]
> The rule found an unexpected error in 'You have bare feet.'
>
> Suggestions please

Try to use our new rule editor here, as it will also show unexpected 
matches.

Best,
MM

>
>
> TiA
>
>


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to