4

LanguageTool can be used as an addon for TeXstudio to check grammar (that happens rule-based). You can also use n-grams as an addition. The description on how to use the n-grams can be found here: http://wiki.languagetool.org/finding-errors-using-n-gram-data

TeXstudio offers an own section in its settings to configure LanguageTool (see below).

I set up n-grams and they work in LanguageTool. LanguageTool also works in TeXstudio. I just can not get the n-grams working in TeXstudio. This is what my configuration looks like:

enter image description here

According to the wiki --config is not needed for standalone, according to the TeXstudio bugtracker it should be there but there is only an example for Linux (which looks pretty much the same). Somewhere I found that it also needs --languageModel which did not work either.

The arguments I tried:

org.languagetool.server.HTTPServer -p 8081 --config "C:/Users/me/.languagetool.cfg" --languageModel="C:/Program Files (x86)/TeXstudio"

org.languagetool.server.HTTPServer -p 8081 --config "C:/Users/me/.languagetool.cfg" --languageModel="C:/Program Files (x86)/TeXstudio/en"

org.languagetool.server.HTTPServer -p 8081 --config "C:/Users/me/.languagetool.cfg"

And probably many others.

Help would be appreciated.

doc
  • 171
  • I've heard of TeXStudio. For the rest, I have no idea what you are talking about. Doesn't mean nobody will, but you might want to edit your question to explain and provide links to the sources you mention consulting. – cfr Feb 20 '17 at 02:11
  • I added some more descriptions but I'm not sure if it is of any use. If someone got it already working he might help. If someone never heard of it he probably won't go ahead and set up everything (which involves downloading an 8Gb database) just to get it working for me. – doc Feb 20 '17 at 02:33
  • No. Not just for you. But people get curious or think it sounds like something they'd like to use and one thing leads to another. – cfr Feb 20 '17 at 04:05

2 Answers2

5

The correct arguments are:

org.languagetool.server.HTTPServer -p 8081 --config "C:\Users\me\.languagetool.cfg" --languageModel "C:\Program Files (x86)\TeXstudio"

The arguments should not contain =.

doc
  • 171
  • It didn't work for me. I also tried --languageModel "/path/to/n-grams" as is recommended on the link you suggested. n-grams works from with the LanguageTool GUI, but not from TeXstudio. – Zoltan Csati Apr 01 '19 at 14:07
  • @ZoltánCsáti I'm not sure of the GUI but if you are using the server then the option is --languageModel and if you are using the command-line then the option is --languagemodel – prash Feb 03 '21 at 07:52
  • @prash That's true. But TeXstudio uses the server and not the command line. – Zoltan Csati Feb 03 '21 at 11:14
0

I figured out a way how the n-grams work in TeXstudio. For this, I use the standalone version of LanguageTool (not that fancy re-made stuff, but the old Java version that you can find here).

There, I added the n-gram database to the settings and also set up the server, which is basically just two ticks: Image of settings in LanguageTool "offline version"

Then you can check if the n-grams are recognized, which works for both the standalone version and TeXstudio (top LanguageTool, bottom TeXstudio):

enter image description here

The standalone sets up a .cfg file in $home$/.languagetool.cfg maybe this can be used as config for the server, but I did not check this.

Hope this helps anybody that has similar problems.

Cheers

Niklas
  • 642
  • 4
  • 13