Bug 687118 - Add a helper script for adding/removing a few words from the Hunspell en-US dictionary; r=smaug

This commit is contained in:
Ehsan Akhgari 2011-09-21 14:14:31 -04:00
parent ea0ed516c3
commit a2e3fa67c0
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
#!/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