gecko/extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/edit-dictionary

31 lines
890 B
Bash

#!/bin/bash
#
# edit-dictionary
# input files:
HUNSPELL_START=hunspell-en_US-20081205.dic
HUNSPELL_DIFF=upstream-hunspell.diff
HUNSPELL_PATCHED=$HUNSPELL_START-patched
HUNSPELL_PATCHED_STRIPPED=$HUNSPELL_PATCHED-stripped
if [ -z "$EDITOR" ]; then
echo 'Need to set the $EDITOR environment variable to your favorite editor!'
exit 1
fi
# Patch Hunspell ($HUNSPELL_START --> $HUNSPELL_PATCHED)
echo Patching Hunspell dictionary
cp $HUNSPELL_START $HUNSPELL_PATCHED
patch $HUNSPELL_PATCHED $HUNSPELL_DIFF
# Open the patched hunspell editor and let the user edit it
echo "Now the dictionary is going to be opened for you to edit. When you're done, just quit the editor"
echo -n "Press Enter to begin."
read foo
$EDITOR $HUNSPELL_PATCHED
# Now, store the hunspell diff in the original diff file
diff $HUNSPELL_START $HUNSPELL_PATCHED > $HUNSPELL_DIFF
# Clean up
rm -f $HUNSPELL_PATCHED