LanguageTool is an open source online grammar, style and spell checker. Installing it is powered by the etke.cc/roles/languagetool Ansible role and Erikvl87/docker-languagetool docker image.
This service requires the following other services:
- Traefik — a reverse-proxy server
To enable this service, add the following configuration to your vars.yml
file and re-run the installation process:
########################################################################
# #
# languagetool #
# #
########################################################################
languagetool_enabled: true
languagetool_hostname: mash.example.com
languagetool_path_prefix: /languagetool
########################################################################
# #
# /languagetool #
# #
########################################################################
In the example configuration above, we configure the service to be hosted at https://mash.example.com/languagetool
.
You can remove the languagetool_path_prefix
variable definition, to make it default to /
, so that the service is served at https://mash.example.com/
.
LanguageTool can make use of large n-gram data sets to detect errors with words that are often confused, like their and there. Learn more in Finding errors using n-gram data.
The n-gram data set is huge and thus not part of the LanguageTool installation. To make use of it with your own LanguageTool server, you may enable n-gram data and choose which languages to download n-gram data for.
For a list of languages for which the Ansible role supports downloading n-gram data, consult the languagetool_ngrams_langs
variable in the default/main.yml
file. Additional languages may be available. If the role doesn't have a download URL for them, consider redefining languagetool_ngrams_langs
yourself with your own language-code to download URL mapping or submit a PR to the languagetool Ansible role.
languagetool_ngrams_enabled: true
# See `languagetool_ngrams_langs` for a list of language-codes
# that the Ansible role supports.
languagetool_ngrams_langs_enabled: ['fr', 'en']
After installing, you can test your instance by making requests to LanguageTool's HTTP API.
An example HTTP request can be made with curl: curl --data "language=en-US&text=a simple test" https://mash.example.com/languagetool/v2/check
See the list of software that supports LanguageTool as an add-on and set https://mash.example.com/languagetool/v2
as the LanguageTool server (assuming you've installed at the /languagetool
path prefix).