With LanguageTool (LT), it’s possible to run a local language tool server and have your browser extension connect to it. That way, your personal prose remains private (if you trust the browser extension, that is). It’s all documented here and it’s pretty simple to do. In this post, I cover how you can do this on Arch Linux (but it’s likely easy to port to other distro) with systemd to keep that server running.
Start by getting LT.
yay -S languagetool
You’ll also need fastText and a language identification model. Fortunately, there’s already 2 good packages for it in AUR (Check the PKGBUILD — one can never be too sure — but it looks correct at the time of writing).
yay -S fasttext fasttext-langid-models
That’s it for the dependencies. Now for your local setup. Create the file ~/.config/systemd/user/my-languagetool.service with the content:
[Unit]
Description=LanguageTool Grammar Checker Server
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/languagetool --http --port 8081 --allow-origin "*" --config %h/.config/LanguageTool/server.properties
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
As well as the file ~/.config/LanguageTool/server.properties with the content:
fasttextModel=/usr/share/fasttext/lid.176.bin
fasttextBinary=/usr/bin/fasttext
And now you’re ready to start your local server and keep it up and running for your browser extension:
systemctl --user daemon-reload
systemctl --user enable my-languagetool.service
systemctl --user start my-languagetool.service
You just need to configure the settings in your browser extension to ensure it connects to your local LT server.