Emacs-langtool icon indicating copy to clipboard operation
Emacs-langtool copied to clipboard

Feature: Enable using the web version of the language tool.

Open markokocic opened this issue 5 years ago • 3 comments
trafficstars

Allow option to connect to and use the remote web version of language tool without installing the language server itself.

markokocic avatar Jun 29 '20 15:06 markokocic

I configured langtool the following way:

(use-package langtool
  :ensure t :defer t
  :custom
  (langtool-http-server-host "languagetool.org")
  (langtool-http-server-port 443)
  (langtool-http-server-stream-type 'ssl)
  )

I also changed langtool-client-http-post to post to /api/v2/check instead of /v2/check

In theory, that should be enough to use https://languagetool.org/api/v2/ as a language server. However, when trying to call it from emacs, I get the following error:

error in process sentinel: langtool-http--parse-response-header: Parse error. Not found http header separator.
error in process sentinel: Parse error. Not found http header separator.

markokocic avatar Jul 06 '20 11:07 markokocic

That wouldn't be possible as the LanguageTool Online Server only meant to be used as a test server, if you do more than 20 request in a minute, you will be banned from the server.

http://wiki.languagetool.org/public-http-api [20 requests per IP per minute (this is supposed to be a peak value - don't constantly send this many requests or we would have to block you)]

PillFall avatar Jul 22 '20 03:07 PillFall

As @PillFall mentionned, that should not be used for other purpose than testing. Working if changed to :

(use-package langtool :ensure t) 
(setq langtool-http-server-stream-type 'ssl) 
(setq langtool-http-server-host "api.languagetool.org")
(setq langtool-http-server-port 443)

dotgreg avatar Dec 11 '21 00:12 dotgreg