Bug 687118 - Add a helper script for adding/removing a few words from the Hunspell en-US dictionary; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 21 Sep 2011 14:14:31 -0400
changeset 77288 1a87f8e7127c84bc51a14cc2dd88d8d6acea1143
parent 77287 29f2b1511a29e87a195addf9afae397d5538c418
child 77289 75dec6517097ca8bc7aa0251872341ba98d939e3
push id21191
push userbmo@edmorley.co.uk
push dateThu, 22 Sep 2011 00:52:59 +0000
treeherdermozilla-central@4495e1f795c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs687118
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 687118 - Add a helper script for adding/removing a few words from the Hunspell en-US dictionary; r=smaug
extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/edit-dictionary
extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/merge-dictionaries
new file mode 100755
--- /dev/null
+++ b/extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/edit-dictionary
@@ -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
old mode 100644
new mode 100755