I am running linter-languagetool with a locally installed languagetool server. I am trying to pass a config file to languagetool server using the settings interface of linter-languagetool.
However, linter-languagetool does not seem to respect the config file.
Actual behavior
For testing purposes I use the following .languagetool.cfg:
maxTextLength=1
However, languagetool server started by linter-languagetool will not consider this config file. For example, if I send a POST
➜ http POST http://localhost:8081/v2/check text=="I can't remember how to go their." language==en-US
HTTP/1.1 200 OK
Content-length: 436
Content-type: application/json
Date: Mon, 06 May 2019 13:05:53 GMT
{
"language": {
"code": "en-US",
"detectedLanguage": {
"code": "en-US",
"confidence": 0.99999094,
"name": "English (US)"
},
"name": "English (US)"
},
"matches": [],
"software": {
"apiVersion": 1,
"buildDate": "2019-03-26 11:37",
"name": "LanguageTool",
"premium": false,
"premiumHint": "You might be missing errors only the Premium version can find. Contact us at support<at>languagetoolplus.com.",
"status": "",
"version": "4.5"
},
"warnings": {
"incompleteResults": false
}
}
Expected behavior
Now, to remove the possibility of problems with the config file itself, I check top for what is actually run and run the server myself.
➜ http POST http://localhost:8082/v2/check text=="I can't remember how to go their." language==en-US
HTTP/1.1 413 Request Entity Too Large
Content-length: 102
Date: Mon, 06 May 2019 13:21:39 GMT
Error: Your text exceeds the limit of 1 characters (it's 33 characters). Please submit a shorter text.
I am not very familiar with Atom plugins, but did some further testing/exploration by modifying linter-languagetool's sources files directly.
It looks like the problem is originating from here
The problem
I am running
linter-languagetool
with a locally installedlanguagetool
server. I am trying to pass a config file tolanguagetool
server using the settings interface oflinter-languagetool
. However,linter-languagetool
does not seem to respect the config file.Actual behavior
For testing purposes I use the following
.languagetool.cfg
:However,
languagetool
server started bylinter-languagetool
will not consider this config file. For example, if I send a POSTExpected behavior
Now, to remove the possibility of problems with the config file itself, I check
top
for what is actually run and run the server myself.Resulting in the expected behavior
Environment
OS:
macOS 10.14.4
Atom:1.36.1
linter-languagetool:0.9.0
languagetool4.5
(installed via brew)Further comments
I am not very familiar with Atom plugins, but did some further testing/exploration by modifying
linter-languagetool
's sources files directly.It looks like the problem is originating from here
https://github.com/wysiib/linter-languagetool/blob/caea6b839e9110efc4f6dabe603b9fa83a590a5c/lib/ltserver-helper.coffee#L131
and here
https://github.com/wysiib/linter-languagetool/blob/caea6b839e9110efc4f6dabe603b9fa83a590a5c/lib/ltserver-helper.coffee#L152
If I modify it in a way that
--config
is passed hardcodedly viajvmoptions.concat
thelanguagetool
server correctly picks up the config file.