From 043bcf4b8af6663c4db989b7cc1fd4869c576e95 Mon Sep 17 00:00:00 2001 From: Dziad Borowy Date: Thu, 27 Oct 2022 15:29:22 +0100 Subject: [PATCH] libregrammar --- apps/other/language-tool.md | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/apps/other/language-tool.md b/apps/other/language-tool.md index 800b15f..847ba83 100644 --- a/apps/other/language-tool.md +++ b/apps/other/language-tool.md @@ -10,7 +10,13 @@ Multilingual grammar, style, and spell checker (similar to Grammarly). ## Optional n-gram data LanguageTool can make use of large n-gram data sets to detect errors with words that are often confused, like `their` and `there`. -1. Download n-gram data: https://languagetool.org/download/ngram-data/ +1. Download & unzip n-gram data for your language: https://languagetool.org/download/ngram-data/ + + ```sh + wget https://languagetool.org/download/ngram-data/ngrams-en-20150817.zip + unzip ngrams-en-20150817.zip + ``` + 2. Uncomment n-gram volume and env variable below ## docker-compose.yml @@ -28,10 +34,36 @@ services: # - langtool_languageModel=/ngrams # OPTIONAL: Using ngrams data - Java_Xms=512m # OPTIONAL: Setting a minimal Java heap size of 512 mib - Java_Xmx=1g # OPTIONAL: Setting a maximum Java heap size of 1 Gib - # volumes: - # - ./data:/ngrams + volumes: + - ./ngrams:/ngrams ``` And then, in a browser extension: - in `LanguageTool API server URL:` select `Other server` - enter: `http://:8010/v2` + + + +## Alternative docker-compose.yml +This is using [libregrammar](https://github.com/TiagoSantos81/libregrammar) version, which (allegedly) provides the premium features for free. + +- [Github repo for libregrammar](https://github.com/TiagoSantos81/libregrammar) +- [Github repo for the docker image](https://github.com/py-crash/docker-libregrammar) + + +```yml +--- +services: + languagetool: + image: registry.gitlab.com/py_crash/docker-libregrammar + container_name: languagetool + restart: unless-stopped + environment: + - langtool_languageModel=/ngrams # OPTIONAL: Using ngrams data + - Java_Xms=512m # OPTIONAL: Setting a minimal Java heap size of 512 mib + - Java_Xmx=1g # OPTIONAL: Setting a maximum Java heap size of 1 Gib + ports: + - "8081:8081" + volumes: + - ./ngrams:/ngrams +```