#!/bin/bash

# minimax: a quicker spellchecker (thanks to pingouinux and nesthib).V1. February 2013.

# Dependencies: zenity, odt2txt, hunspell, hunspell-en-us (check for your own language here)

name=$(zenity --entry --title "Name of odt file" --text "Write here the name of your odt file" --entry-text=Name?)
echo "name=$name"

odt2txt --width=-1 "${name}".odt > "${name}".txt

# Standard listing of unknown and/or mispelled words.

sed 's/[^[:alpha:]-]/\n/g' "${name}".txt | grep '^[[:alpha:]]' | sort -u  > "${name}"2.txt

hunspell -l "${name}"2.txt > "${name}"3.txt

# Elided forms listing.

grep -oe "[[:alpha:]]\+['][[:alpha:]'-]*[[:alpha:]]\+" "${name}".txt | sort -u > "${name}"4.txt

hunspell -l "${name}"4.txt > "${name}"5.txt

echo "Done"
zenity --info --text "Done"










