Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with "--langguagemodel" option #34

Open
puth7 opened this issue Jun 2, 2018 · 4 comments
Open

Error with "--langguagemodel" option #34

puth7 opened this issue Jun 2, 2018 · 4 comments

Comments

@puth7
Copy link

puth7 commented Jun 2, 2018

Hi, I was trying to add the --languagemodel option with the english n-gram data, but it does not work as expected (it was fine without the --langguagemodel).
The init.el file is as follow:

(setq langtool-language-tool-jar "/opt/program/nux/LanguageTool-4.1/languagetool-commandline.jar" )
(require 'langtool)

(setq langtool-java-user-arguments '(--languagemodel "/opt/program/nux/LanguageTool-4.1/ngrams"))

When I run M-x langtool-check,
it gave error message
LanguageTool exited abnormally with code 1 (Unrecognized option: --languagemodel /opt/program/nux/LanguageTool-4.1/ngrams)

Did I made a mistake?
Thanks!

@heikkil
Copy link

heikkil commented Jun 27, 2018

@puth7, I think --languagemodel string should be inside those quotes. The error comes from that. However, adding it in and escaping the quotes does not solve the problem.

Documentation states that langtool-user-arguments works the same as langtool-java-user-arguments, but when I set it to '(\"--languagemodel ~/data/lt\"), I get an stringp error.

Setting it to "--languagemodel ~/data/lt" does not give an error but does not do anything.

Adding --languagemodel option to the languagetool command line tool works for me, so the correct syntax should be possible to find.

@puth7
Copy link
Author

puth7 commented Jun 27, 2018

Hi @heikkil,
Thanks for your response.
The command line "--langguagemodel" option also works fine with me.
I absolutely agree with you, so far my best approach is trial and error.

@eli-tziperman
Copy link

eli-tziperman commented Aug 26, 2018

hi, was this problem solved? I was having the same issue, and I think I resolved it, using the following settings:

'(langtool-default-language "en-US")
'(langtool-disabled-rules " ")
'(langtool-language-tool-jar "/usr/local/LanguageTool-4.2/languagetool-commandline.jar")
'(langtool-mother-tongue "en")

and
(setq langtool-user-arguments '("--languagemodel" "/usr/local/LanguageTool-n-gram/"))

not sure if all are actually necessary...

@gwern
Copy link

gwern commented Nov 11, 2019

Experimenting, it seems that it's undocumented that each space-separated string on the CLI must also be separate spaces in the langtool-user-arguments list as well. That's why '("--languagemodel" "/usr/local/LanguageTool-n-gram/") works, but '("--languagemodel /usr/local/LanguageTool-n-gram/") does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants