Back to LanguageTool Homepage - Privacy - Imprint

Trying to disable WordRepeatRule

(Michael) #1

Due to the structure of my text, I get a lot of warnings, saying:

"Possible typo: you repeated a word"

So, I wanted to disable the responsible rule. A search through the source code gave only one usage of the MessageBundle entry "repetition" and this was the WordRepeatRule. So, I added the following to my code:


Afterwards, the "you repeated a word" warnings are still there and there are nearly 50% more spelling errors than before!
How can this be? I thought, that the rules are independent.
And what is the proper way to disable the rule?

(Daniel Naber) #2

For English, try ENGLISH_WORD_REPEAT_RULE, for German GERMAN_WORD_REPEAT_RULE. langTool.disableRule() is the correct method to call.

(Michael) #3

That works.
And when I moved the disableRule call before the position where I created a new MorfologikSpellerRule I got rid of the increased spell checker errors.

(Atiqur Sumon) #4

Is this is german word go to google translate and first translate.