Back to LanguageTool Homepage - Privacy - Imprint

Less simple replace rule


(Ruud Baars) #1

I see a lot of errors when reading the examples I collected. But (to be honest) I am too lazy to make a XML rule for all of them. When replacing a group of words by any other group of words, it is generally enough to just do that, no postags, nothing fancy.

Wouldn’t it be simpler to have a file for those rules and a Java rule that just says 'You might mean : ’

A bit like an AI rule, but manually.


(Daniel Naber) #2

Isn’t that what replace.txt does, just with a slightly different message?


(Ruud Baars) #3

As far as I can see, it does that for one word in only. I tried with multiple, but no success. If it did work for more than 1 word, the compound rule would be superfluous.


(Daniel Naber) #4

A small code change seems to be all it needs to make that work. I will commit that in a few minutes, could you test it? If it works, one string will also need to be translated in SimpleReplaceRule.


(Ruud Baars) #5

Compiling now.


(Ruud Baars) #6

Just edited the message. And commited.

By the way, now in fact, compounds.txt is not needed anymore, since all of the rules there can be rewritten into replacements. Right? Or am I missing something?