Add word to dictionary

Using the Java API I can see that there is an addIgnoreTokens method but I don’t see any way of dynamically adding words to the dictionary so that they will be taken into account for suggestions.

I have seen mention that you can add words to spelling.txt but where would I put this file? I am using maven to pull in LanguageTool into my Java project and I don’t have access to the LanguageTool resource paths.

Is this possible?

Thanks

Getting suggestions for dynamically added words might not be supported (Adding words to spelling.txt in a Grails project).

spelling.txt is at e.g. org/languagetool/resource/en/hunspell/spelling.txt, local changes should be made to spelling_custom.txt.