Free spell checking
You probably know about Grammarly and other web browser add-ons that basically act as fancier spell checkers.
They’re expensive, a bit opaque, and you can’t really integrate them into whatever you want.
Well today, I’ll talk about LanguageTool. Despite offering full-blown plans, what is little known is that you can use it locally and host your own spell checker for free!
Setting this up#
I personally use Fedora Linux, so this tutorial will assume you have a similar setup. This particular one should work for any Systemd-enabled distribution.
First, you’ll need to download the latest LanguageTool HTTP server snapshot from their mirror which should be in the form of a zip file, then unzip it which should leave you with a file named something like LanguageTool-6.6-SNAPSHOT
(replace the 6.6-SNAPSHOT
by the version you downloaded).
For simplicity’s sake, let’s rename LanguageTool-6.6-SNAPSHOT
into languagetool
and move it to our own folder with:
mv LanguageTool-6.6-SNAPSHOT languagetool
mv languagetool ~
You can also go in that directory using cd ~/languagetool
and type pwd
to get the full path to there, we’ll need it a bit later.
Now, time to create a systemd service to start it automatically. First, we’re gonna have to create the folder ~/.config/systemd/user/
using mkdir -p ~/.config/systemd/user/
.
Once this is done, you can then edit the languagetool.service
file using your favourite editor, in my case, Sublime Text: subl ~/.config/systemd/user/languagetool.service
.
In there, you can put the following sample service file, feel free to tweak it accordingly to your needs, but this should be good for most use cases (replace jae
by your user):
[Unit]
Description=LanguageTool server
After=graphical.target
[Service]
WorkingDirectory=/home/jae/languagetool
ExecStart=java -cp languagetool-server.jar org.languagetool.server.HTTPServer --config server.properties --port 8081 --allow-origin
[Install]
WantedBy=default.target
Before, anything, go in the ~/languagetool
directory and create the server.properties
file by using: touch ~/languagetool/server.properties
.
Now time to start and enable the service:
systemctl --user start languagetool
systemctl --user enable languagetool
And there you go, your local LanguageTool server will be started automatically when you log into your session.
Now you, as a finishing touch, you can install the Firefox add-on, and once install, go in the settings, scroll all the way at the bottom, click on the “advanced settings” tab, and swap the “LanguageTool server” option to “local server”.
Congratulations, you now have an amazing spell checker in your browser for 100% free.
If you’re curious about how exactly that stuff works, you can see the full LanguageTool source on GitHub.
If you are a developer, check out their API docs to build stuff around it.
If you liked this post, you can subscribe to this blog through RSS to not miss any future ones.