Back to LanguageTool Homepage - Privacy - Imprint

Ngram installation directory

I downloaded the ngram in my root directory.
As per the install doc,

  1. Unzip it and put it in its own directory named en, de, fr, or es, depending on the language. The path you need to set in the next step is the directory that the en etc. directory is in, not that directory itself.

So I copied the ngram.zip to /en/ directory.
Is there any other step required.
I am unable to connect to the LT tool from a client machine using chrome LT extension.

Can you please help me where I need to have the ngram placed.

Here is my folder structure:

[ec2-user@ip-xx-xx-13-63 en] pwd /home/ec2-user/en I have copied Ngrams-en to the /en directory. [ec2-user@ip-xx-13-63 en] ls
1grams 2grams 3grams ngrams-en-20150817.zip

[ec2-user@ip-xx-xx-13-63 en]$

You forgot the “unzip it” step :slight_smile:

I am unable to connect to the LT tool from a client machine using chrome LT extension.

What error do you get? How have you started LT?

Thanks for the prompt answer.
the /en directory was created after unzipping the ngrams.

So, If I understand you I just create an empty directory /en and then unzip the Ngrams, this should work?

Yes LT is started and I am running LT in a Different Server than the client.
I get an error , cannot connect to the LT.
I have confirmed telnet to port 8081 works from client to server.

Yes.

Yes, but what command exactly did you use to start it?

HI,
So I unzipped the Ngram inside the /en folder.

I am using the cmd for starting LT -

java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081 --allow-origin ‘*’ --public --languagemodel ‘/home/ec2-user/LanguageTool-4.7/org/languagetool/rules/en/en-US’
The JAVA service starts, but when i go the client to point to the Private IP of the Lang tool server under Experimental Settings I am getting error:
“Something went wrong while checking your text”
Port 8081 is reachable from the Client to the LT server. I can telnet to that port.

I even checked with cmd
java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081 --allow-origin ‘*’
Still I cannot use the LT on the client side.
FYI - I am testing this while composing a email on gmail.

Another error now after I ran the above command
Cannot connect to http://172.31.13.63/check (#1, code=undefined)
here 172.31.13.63 is where my LT server is running.

What does LT print on the command line? I think the proper parameter will be --languagemodel /home/ec2-user/LanguageTool-4.7/org/languagetool/rules/, i.e. the directory in which you can find the en folder.

So this en folder is there under the path
/home/ec2-user/LanguageTool-4.7/org/languagetool/rules/
But the Ngrams is under another /en folder which I created manually.

I tested with below command:

java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081 --allow-origin ‘*’ --public --languagemodel ‘home/ec2-user/LanguageTool-4.7/org/languagetool/rules/en/’
Still getting error on the client:
Cannot connect to http://172.31.13.63/check (#1, code=undefined)

If I do a curl on the LT server itself

curl --data “language=en-US&text=a simple test” http://localhost:8081/v2/check

{“software”:{“name”:“LanguageTool”,“version”:“4.7”,“buildDate”:“2019-09-28 10:09”,“apiVersion”:1,“premium”:false,“premiumHint”:“You might be missing errors only the Premium version can find. Contact us at supportlanguagetoolplus.com.”,“status”:""},“warnings”:{“incompleteResults”:false},“language”:{“name”:“English (US)”,“code”:“en-US”,“detectedLanguage”:{“name”:“French”,“code”:“fr”,“confidence”:0.815771}},“matches”:[{“message”:“This sentence does not start with an uppercase letter”,“shortMessage”:"",“replacements”:[{“value”:“A”}],“offset”:0,“length”:1,“context”:{“text”:“a simple test”,“offset”:0,“length”:1},“sentence”:“a simple test”,“type”:{“typeName”:“Other”},“rule”:{“id”:“UPPERCASE_SENTENCE_START”,“description”:“Checks that a sentence starts with an uppercase letter”,“issueType”:“typographical”,“category”:{“id”:“CASING”,“name”:“Capitalization”}},“ignoreForIncompleteSentence”:true,“contextForSureMatch”:-1}]}

It seems the port is missing here?

Nope, I tried
http://172.31.13.63:8081/check

still getting error “something went wrong while checking your text”

Probably v2 is missing (unless you have some mapping), as in http://172.31.13.63:8081/v2/check. Also, what does the LT server print to the console?

Hi Daniel,

Thank you for your help.
So I have my client pointing to http://172.31.13.63/check

I took a network capture and I see Http 400 Bad request and the error is
HTTP/1.1 400 Bad Request
Date: Wed, 30 Oct 2019 17:09:54 GMT
Access-control-allow-origin: *
Content-length: 141

Error: This is the LanguageTool API. You have not specified any parameters. Please see https://languagetool.org/http-api/swagger-ui/#/default

How exactly to do this?

Look at what the server process prints where you started it. But the server reply to the client already tells you the problem and where to look for the solution: “You have not specified any parameters. Please see https://languagetool.org/http-api/swagger-ui/#/default