Hello all,
I’m new in using LT and I would like to parse several files to check spelling errors applying the correction automatically.
I’m using windows and ubuntu - Java 8.
My example file is a text file in utf-8 with this sentence written on it “Remmember how it goes”. Obviously I would like to have “Remember how it goes”.
This is what it happens:
C:\Users\KP\Desktop\LanguageTool-3.3>java -Dfile.encoding=UTF-8 -jar languagetool-commandline.jar -adl -a C:/Users/KP/Desktop/test.txt
Working on C:/Users/KP/Desktop/test.txt…
Using English for file C:/Users/KP/Desktop/test.txt
Remmember how it goes.
It seems that it didn’t correct the sentence… Why?
-adl will only detect the language like “English”, but not its variant, like “English (US)”. This means no spell checking can be activated. So you’ll need to specify the language like -l en-US. Anyway, I don’t think automatically applying suggestions is a good idea. The risk of introducing new errors is high, and several errors don’t have a suggestion and will be ignored.
I did it also with “fr” in a french sentence but it doesn’t work. I would like to correct just a list of words in french where, for example, the accent is missing. Is it possible with LT?
The process for spell checking is independent of the grammar rules described on that page. How spell checking works is documented at Spell check - LanguageTool Wiki.
Using the hunspell native code (which comes with LT) is kind of deprecated, although I don’t see it being removed any time soon. If you stick to the morfologik code (which is pure Java) as described in the Wiki, everything should be fine.
I’ve updated the Wiki page with the latest class name. The parameters might be different, but the class will show its usage when you call it without parameters.
It looks like the dictionary was actually created. I see this message when I create my dictionary and it succeeds.
But I agree we need to remove the message.
Yes it looks like the dict was created but it wasn’t. I already executed the code on Windows 7 and Ubuntu with Java 8 and… Nothing has changed !
Maybe the .txt file with the dictionary word list on it, should have a different layout?
In my file, words are listed in this way - utf-8:
a
b
c
d
...etc
It looks like FSACompile doesn’t work.
Invalid argument: Unknown option: --overwrite
Moreover, I noticed that the file created by LT (I suppose) C:\Users\KP\AppData\Local\Temp\SpellDictionaryBuilder257816875475185246.txt
disappears few seconds after the code is executed. I thought that it was my antivirus and I disabled it… But again nothing has changed.