This egg installs a LanguageTool server LanguageTool is an Open Source proofreading software for English, French, German, Polish, Russian, and more than 20 other languages. It finds many errors that a simple spell checker cannot find. View https://languagetool.org for more information.
LanguageTool is an Open Source proofreading software for English, French, German, Polish, Russian, and more than 20 other languages. It finds many errors that a simple spell checker cannot find.
View https://languagetool.org for more information.
Requires one port for comunication.
Try addr:port/v2/check?language=en-US&text=this+is+a+test
to test
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:java_17 | ghcr.io/ptero-eggs/yolks:java_17 |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Include traindata | This uses many gigabytes of disk space. Separate each value with spaces. For example, "de en". View all available models at https://languagetool.org/download/ngram-data/ | TRAIN_MODELS | Yes | Yes |
#!/bin/ash
apk add --no-cache unzip # to make shure the unzipper is working properly
mkdir -p /mnt/server
mkdir -p /mnt/server/models
touch config.properties
# if TRAIN_MODELS has content install them
if [ -n TRAIN_MODELS ]; then
content=$(curl -L https://languagetool.org/download/ngram-data/)
links=$(echo "$content" | grep -o '<a href="[^"]*\.zip">' | sed 's/<a href="//' | sed 's/">//')
echo $links
cd /mnt/server/models
for model in $TRAIN_MODELS; do
echo "$model"
for link in $links; do
# echo " $link"
if [[ $link == *"-$model-"* ]]; then
fullLink="https://languagetool.org/download/ngram-data/$link"
echo "Downloading $fullLink"
echo "this could take some while"
curl $fullLink --output $model.zip
echo "unziping $model.zip"
unzip $model.zip
rm $model.zip
fi
done
done
fi
# main languagetool install
cd /mnt/server
echo "downloading languagetool"
curl https://languagetool.org/download/LanguageTool-stable.zip --output download.zip
echo unziping
unzip download.zip
echo moving files
cp -r LanguageTool-*/* .
rm -rf LanguageTool-*
rm download.zip -rf
echo Finished install