Back to LanguageTool Homepage - Privacy - Imprint

New Spell checking feature - any way to use a custom dictionary


(Rich K) #1

I am evaluating LanguageTool and other libraries to use in a financial company's Java Publishing application that we are building. Our new application pulls data from several other disparate repositories, then presents different information to the end user for review and approval & eventual publishing to web & print systems.

Part of the new app's job will be to run spell & grammar validation on financial commentaries and other
artifacts that were created and stored in some of these other repositories. We want spell-checking on but as you can imagine there is a lot of acronyms and codes in the financial industry that will require us to build an acceptable list of misspellings.

Does the new LanguageTool Spell Checking feature support custom dictionaries in addition to the built in dictionaries? I have looked through the web site, JAVA API, documents, and forums and have not found mention of how to add your own words or dictionaries specifically. After looking at the JAVA API I think that the approach might be to use SpellingCheckRule(s) but am a bit confused because those classes seemed to be structured to only find errors or can I use a SpellingCheckRule to identify acceptable spellings also?

Thanks,

Rich


(Daniel Naber) #2

Am Freitag, 3. August 2012, 08:20:05 schrieben Sie:

Does the new LanguageTool Spell Checking feature support custom
dictionaries in addition to the built in dictionaries?

It's not possible yet but I see that this is important for a lot of people,
so I will try to add it soon.

For now, you could try something like this:

langTool.disableRule(MorfologikAmericanSpellerRule.RULE_ID);
langTool.addRule(new MySpellRule());

Where MySpellRule is a copy of MorfologikSpellerRule that ignores certain
words in its match() method.

Regards
Daniel

--
http://www.danielnaber.de


(Daniel Naber) #3

The very latest snapshot from http://www.languagetool.org/download/snapshots/?C=M;O=D should now support this. Just add a file called ignore.txt to resource/xx/hunspell/ignore.txt (xx being the language code), with one word per line. English and German have such a file already with a single test entry. Those words will be ignored during spell checking. Please let me know if this works for you.


(fusubacon) #4

Hello, if I just want to use languagetool library through maven, is there a way to load the dictionary through JavaAPI?


(Daniel Naber) #5

This is documented at http://wiki.languagetool.org/java-spell-checker.


(matusha) #6

Hi There,

I have seen the server-side based textfile for the custom dictionary.

But what is not clear to me is:

Is it possible to use the javascript to save dynamically the custom dictionary words in an own hosted language tool installation ?

Is it possible to use a custom dictionary per language ?

I'm much interested in the javascript usage of such API.

Thanks in advance
-Igor


(Daniel Naber) #7

There's no way to tell the server about ignored words via HTTP API. You will need to ignore the words on the Javascript side by filtering the errors.


(Maulik Patel) #8

But, I want to put my spelling.txt file in "user.home" directory. that is not working.