texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Add support for LanguageTool Plus

Open jonasbb opened this issue 7 years ago • 4 comments

TeXstudio already offers a LanguageTool integration, but it is currently not compatible with LanguageTool Plus. LanguageTool Plus is a hosted service and offers additional rules compared to the free version.

Would it be possible to add support for LanguageTool Plus? The API is 100% identical to the free version, only missing are username and password fields for authentication. Daniel Naber from LanguageTool Plus mentioned via email that a free LanguageTool Plus account would be provided for testing.

jonasbb avatar Nov 27 '18 23:11 jonasbb

what is the url supposed to look like. I have not seen a description (yet).

sunderme avatar Dec 31 '18 11:12 sunderme

How sad, nobody provided any information: the API is described here LanguageTool Plus API.

Hence, the URL and the response are very similar to the regular version. Here one example for the url: https://api.languagetoolplus.com/v2/check?text=<encoded Text under Test, i.e.: %3CText%20under%20Test%3E>&language=<language of the interface, i.e. "de-DE">&username=<encoded (@=%40)e-mail address of account>&password=<Accounts Password>&enabledOnly=false alternatively to &password=<Accounts Password> the use of an api-key is possible with &apiKey=<API-Key>

The JSON-response (in case of an error oly recognized by LTplus) looks like {"software":{"name":"LanguageTool","version":"4.6-SNAPSHOT","buildDate":"2019-06-18 13:58","apiVersion":1,"premium":true,"status":""},"warnings":{"incompleteResults":false},"language":{"name":"German (Germany)","code":"de-DE","detectedLanguage":{"name":"German (Germany)","code":"de-DE","confidence":0.891}},"matches":[{"message":"Meinten Sie \"äußert sich\" oder \"äußerst dich\", oder fehlt hier ein Komma?","shortMessage":"","replacements":[{"value":"äußert sich"},{"value":"äußerst dich"}],"offset":3,"length":12,"context":{"text":"Er äußerst sich nicht dazu.","offset":3,"length":12},"sentence":"Er äußerst sich nicht dazu.","type":{"typeName":"Other"},"rule":{"id":"AEUSSERST_SICH","subId":"1","description":"äußerst (äußert) sich","issueType":"uncategorized","category":{"id":"TYPOS","name":"Mögliche Tippfehler"},"isPremium":true},"ignoreForIncompleteSentence":false,"contextForSureMatch":0}]}

The ordering of the elements in the URL seems not to be relevant.

tsfg avatar Jul 11 '19 00:07 tsfg

Is there any update on this? Also waiting for the support for LT Plus. It seems that the version 3.0.0rc1 does not have the option to add a username for LT Plus.

wenlzhang avatar Aug 14 '20 16:08 wenlzhang

Meanwhile, you can change the LanguageTool Server-URL to the LanguageTool Plus URL like so:

https://api.languagetoolplus.com/v2/check?username=<YOUR E-MAIL>&apiKey=<YOUR API-KEY>&null=

The &null= at the end is important because TexStudio will append /v2/check to the URL, which would otherwise be invalid.

The result would then look like this:

languagetool

s1e2b3i4 avatar May 26 '22 15:05 s1e2b3i4