PillFall / languagetool.el

LanguageTool suggestions integrated within Emacs
GNU General Public License v3.0
98 stars 8 forks source link

Premium account #11

Closed genomorro closed 2 years ago

genomorro commented 2 years ago

Hi. I don't know how LT works exactly, Is it possible to use a Premium account with this extension?

Use the online API without installing LT locally would be great. Sorry if this is off-topic.

PillFall commented 2 years ago

Hi, do not worry, it is not off-topic.

And yeah, it is possible to use this package with any LanguageTool server (at least those with v2 API, probably need to fix that in the future). As I mention in the Read Me file:

If you are going to use a server with another configuration, like servers not located in your localhost, you must set languagetool-server-host and languagetool-server-port to whatever adjust your needs. These variables play in the communication to the LanguageTool HTTP API.

In this case, you should use a config like

(setq languagetool-server-host "https://api.languagetool.org"
      languagetool-server-port 80)

languagetool-server-mode do NOT start any server, but check if it can connect to a server given by those two variables

Right now, the package is not receiving apiKey for Premium features (will implement that these days)

genomorro commented 2 years ago

Ok, I will buy a premium account soon, and I will share what happens.

PillFall commented 2 years ago

Now the package have integration (only in server mode) for premium features

gwbrck commented 1 year ago

How am I supposed to set this up? Apart from setting languagetool-api-key and languagetool-username. Do I need to set languagetool-server-host and port?

gwbrck commented 1 year ago

I had the wrong port configured. For me, it was 443. Now it works.

PillFall commented 1 year ago

How am I supposed to set this up? Apart from setting languagetool-api-key and languagetool-username. Do I need to set languagetool-server-host and port?

Yeah, you must set languagetool-api-key, languagetool-username, languagetool-server-host and languagetool-server-port to match your setup (pointing probably to languagetool.org). Hope it works well for you 😁

genomorro commented 1 year ago

Hi,

Yesterday, finally I bought a premium account.

This config works with a free service:

(use-package languagetool
  :bind
  ("C-$" . languagetool-correct-at-point)
  ("C-c S" . languagetool-set-language)
  :ensure t
  :commands (languagetool-check languagetool-clear-suggestions languagetool-correct-at-point
             languagetool-correct-buffer languagetool-server-mode languagetool-server-start
             languagetool-server-stop languagetool-set-language)
  :custom
  (languagetool-server-port 443)
  (languagetool-server-url "https://api.languagetool.org")
  :hook ((org-mode text-mode) . languagetool-server-mode)
  )

However, this doesn't work:

(use-package languagetool
  :bind
  ("C-$" . languagetool-correct-at-point)
  ("C-c S" . languagetool-set-language)
  :ensure t
  :commands (languagetool-check languagetool-clear-suggestions languagetool-correct-at-point
             languagetool-correct-buffer languagetool-server-mode languagetool-server-start
             languagetool-server-stop languagetool-set-language)
  :custom
  (languagetool-server-port 443)
  (languagetool-server-url "https://api.languagetoolplus.com")
  (languagetool-username "me@mail.com")
  (languagetool-api-key "my-key")
  :hook ((org-mode text-mode) . languagetool-server-mode)
  )

I'm following LT documentation, What am I doing wrong?

tom111 commented 1 year ago

I'm following LT documentation, What am I doing wrong?

I'm trying to do the same. I believe premium API access is a different product still. If you have a personal account with premium activated you cannot use the API which currently would cost 40EUR a month for 250 calls a day: https://languagetool.org/proofreading-api

I'm still trying to figure out the best usage pattern of LT in Emacs, especially with premium. For example, features like "learn spelling" are not exposed in Emacs. So with a technical text that contains an unknown word 100 times, one will suffer a lot to mark all the 100 words to be ignored. Presently, LT in Emacs is not useful for me (premium or not...)

Some old forum entry regarding the stand-alone server: https://forum.languagetool.org/t/does-a-local-server-use-premium-features-if-i-have-a-premium-account/7100