Daniel Naber <daniel.na...@languagetool.org> wrote:

> On 2014-09-09 13:50, Daniel Naber wrote:
>
>> I think the new rule filter offers a solution for this that does not
>> require any changes to the XML. Mike posted an example where he wanted
>> to match in(.*) and un(.*), but only if the matching part is an
>> adjective.
>
> I've just added such a filter. It can be used like this:
>
>       <pattern>
>           <token regexp="yes">in.*</token>
>       </pattern>
>       <filter
> class="org.languagetool.rules.en.EnglishPartialPosTagFilter"
>               args="no:1 regexp:in(.*) postag_regexp:JJ"/>
>
> This will only keep matches for words that start with 'in' and where the
> part after the 'in' is an adjective (POS tag 'JJ'). The 'no:1' is the
> token position, i.e. here the first (and in this case only) matching
> <token> is referred to.
>
> It's available only for English, but it can easily be made available for
> other languages (see EnglishPartialPosTagFilter, all the logic is in
> PartialPosTagFilter that needs to be extended).
>
> Regards
>   Daniel

Hi Daniel

I'm replying late on this old thread.  I've just started to use this
feature in French. I've also added a parameter postag_negate=yes
to the PartialPosTagFilter rule.  Please review the Java changes here:

https://github.com/languagetool-org/languagetool/commit/5334b55c08624a81009c822455bab2b832c699aa

Regards
Dominique

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to