Back to LanguageTool Homepage - Privacy - Imprint

English spelling - detect inconsistency US vs GB

What is the most efficient way of checking whether English spelling is inconsistent (US vs British and the other way around)? I know that I can set the language e.g., to en-GB and if there are words with US spelling that will list them. But what if I don’t know whether the user is writing in GB or US and I want to show error only if the text contains both GB and US spelling, meaning it is inconsistent.
I could send the text twice once with language setting as GB and if US spelling found, then resend with language setting as US and check if GB spellings found, but this is rather inefficient.

Auto-detection of language seems to always classify English text as en-US.

If you have any ideas, please let me know.

@gin, which word variants do not give a warning for inconsistency?

LanguageTool finds inconsistent spellings in a text. For example, if you enter commenter and commentor, you get a message “Do not mix variants of the same word (‘commentor’ and ‘commenter’)…”. For British English, you also get a spelling warning for ‘commentor’.

Look at the file \org\languagetool\rules\en\coherency.txt. This file shows all the word variants in LT.

Thanks for the response.
The rule you mentioned detects different variants of the same word. I am looking for an option which detects different words. For example: “There are two colours white in the center and black outside.” Where ‘colours’ is British and ‘center’ US. When submitting the text I do not know whether the text is US English or GB, so I dont want to trigger any error as long as all the words are not mixed across all the text.

I think it should also check if the mixed spelling is the result of British text on an American subject (EG: The Times reporting on a warning from the United States Centers for Disease Control and Prevention) or vice versa, where it would be appropriate.