Back to LanguageTool Homepage - Privacy - Imprint

Repeated Words in Text (not in sentence)


(JanefM) #1

Hello,

I am trying to implement a rule which checks for word repetitions with a text. While each sentence might be ok, the might be bad.

I can not find any way of specifying the minimal word distance between two occurances of the same word.

Is there any tutorial I can start from? Thanks in advance.


(Daniel Naber) #2

You can only do that by programming a rule, not with XML rules. Here's a simple demo rule that works on sentences: https://github.com/languagetool-org/languagetool/blob/master/languagetool-core/src/main/java/org/languagetool/rules/DemoRule.java. For rules that work on more than single sentences, just extend TextLevelRule instead.