PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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