/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

  1. #!/bin/bash
  2. #
  3. # edit-dictionary
  4. # input files:
  5. HUNSPELL_START=hunspell-en_US-20081205.dic
  6. HUNSPELL_DIFF=upstream-hunspell.diff
  7. HUNSPELL_PATCHED=$HUNSPELL_START-patched
  8. HUNSPELL_PATCHED_STRIPPED=$HUNSPELL_PATCHED-stripped
  9. if [ -z "$EDITOR" ]; then
  10. echo 'Need to set the $EDITOR environment variable to your favorite editor!'
  11. exit 1
  12. fi
  13. # Patch Hunspell ($HUNSPELL_START --> $HUNSPELL_PATCHED)
  14. echo Patching Hunspell dictionary
  15. cp $HUNSPELL_START $HUNSPELL_PATCHED
  16. patch $HUNSPELL_PATCHED $HUNSPELL_DIFF
  17. # Open the patched hunspell editor and let the user edit it
  18. echo "Now the dictionary is going to be opened for you to edit. When you're done, just quit the editor"
  19. echo -n "Press Enter to begin."
  20. read foo
  21. $EDITOR $HUNSPELL_PATCHED
  22. # Now, store the hunspell diff in the original diff file
  23. diff $HUNSPELL_START $HUNSPELL_PATCHED > $HUNSPELL_DIFF
  24. # Clean up
  25. rm -f $HUNSPELL_PATCHED