/extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/edit-dictionary
http://github.com/zpao/v8monkey · #! · 30 lines · 25 code · 5 blank · 0 comment · 0 complexity · 09855d60e4dee335668d2cde0b63f7ef MD5 · raw file
- #!/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