This scripts use LanguageTool for english spelling you can change it if you want to
This scripts also use Pando please make sure installing it before continue
- Copy the script to your
bin
directory, on mine is calledspelling
- sudo chmod 755 FILENAME
- Use it :)
read -e -p "Which file? " file
cp $file backup_$file
echo "creating backup file"
pandoc $backup_$file -f markdown -t plain -o interpretation.txt
echo "interpretation created"
echo "contacting Language Tool, please wait "
plain=`cat interpretation.txt`
curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --data-urlencode "text=$plain" -d 'language=en-US&enabledOnly=false' 'https://languagetool.org/api/v2/check' -o spelling_errors.json
rm interpretation.txt
echo "interpretation file cleaned"
rm backup_$file
echo "backup file cleanded"
echo "opening results"
open spelling_errors.json