Back to LanguageTool Homepage - Privacy - Imprint

Simple rule example


(JensP) #1

Hi,

we want to write a simple Java Rule which should ignore web addresses. What is the best way? We prefer a Java solution. Can we or should we use a disambiguator for that?

kind regards

Jens


(Daniel Naber) #2

Do you want the rule to complain about the use of web addresses? Then see http://wiki.languagetool.org/development-overview#toc16

To ignore parts of the text you can use the disambiguator, please see http://wiki.languagetool.org/developing-a-disambiguator#toc9


(JensP) #3

Hi,

yes thank you. I think to use disambiguator and "Ignoring in spell-checking rules" is the correct way for us. We want exclude web addresses / urls from checking at all.

Is there a way to add a disambiguator programatically with Java?


(Daniel Naber) #4

I think that's possible if you implement your own language (or extend the language class you're using, e.g. English.java) and then return your new Disambiguator in the getDisambiguator() method.