summaryrefslogtreecommitdiffstats
path: root/l10n-zh-TW/extensions/spellcheck/hunspell/dictionary-sources/edit-dictionary
blob: ad77e47fd12a98c27abdaceaec68919472495566 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

#
# edit-dictionary

set -e

if [ -z "$EDITOR" ]; then
  echo 'Need to set the $EDITOR environment variable to your favorite editor!'
  exit 1
fi

# Strip the first line that contains the count
tail -n +2 ../en-US.dic > en-US.stripped

# 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 en-US.stripped

# Add back the line count
wc -l < en-US.stripped | tr -d '[:blank:]' > en-US.dic
LC_ALL=C sort en-US.stripped >> en-US.dic

# Clean up
rm -f en-US.stripped