Back to LanguageTool Homepage - Privacy - Imprint

Spell checker - Adding new words with suggestion

Hi team,

I would like to know how to add new words with it’s suggestions to existing dictionary in LT.
Below is the procedure i followed, but i found after updating new words to dictionary it started showing errors on some common prepositions as well (say in, for etc…)

Step 1:
Extracted the text file
java -cp languagetool.jar org.languagetool.tools.DictionaryExporter -i org/languagetool/resource/en/hunspell/en_GB.dict -info org/languagetool/resource/en/hunspell/en_GB.info -o /tmp/out.txt

Step 2:
Removes all the frequencies

Step 3:
Added my new words

Step 4:
java -cp languagetool.jar org.languagetool.tools.SpellDictionaryBuilder de-DE /path/to/out.txt org/languagetool/resource/en/hunspell/en_GB.info - -o /tmp/en_GB.dict

Step 5:
Copied the file into dictionary path.

I am missing clarity on how to choose this frequency (say “+E”) for my new work that i am going to add to my dictionary.

Thanks,
Deepika D

If you know the replacement, you can just add all words to spelling.txt and the words and their replacements to replace.txt. This way you don’t need to deal with frequencies.

Hi Daniel,

Thank you so much for the swift response.
That’s really a good suggestion.

But our requirement is to include our own dictionary with medical and scientific words. Adding such a large set of data to “spelling.txt” and “replace.txt” won’t over load the LT service?

Thanks,
Deepika

I haven’t tested a large replace.txt file, but adding e.g. 100,000+ words to spelling.txt (or better to spelling_custom.txt) is okay.

Thank you Daniel :slight_smile:
Let me try it out then.

Thanks,
Deepika

For Step 4 we use script from: