File: update-cmigemo-dict

package info (click to toggle)
cmigemo 1:1.2+gh0.20140306-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,668 kB
  • ctags: 1,550
  • sloc: ansic: 2,617; lisp: 656; cs: 188; makefile: 174; sh: 172; cpp: 67; perl: 59; csh: 49
file content (44 lines) | stat: -rw-r--r-- 1,013 bytes parent folder | download | duplicates (4)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# dictionary update script for cmigemo
#
set -e

# check scripts
SKK2MIGEMO_PL=/usr/share/cmigemo/tools/skk2migemo.pl
[ -x $SKK2MIGEMO_PL ] || exit 1
OPTIMIZE_DICT_PL=/usr/share/cmigemo/tools/optimize-dict.pl
[ -x $OPTIMIZE_DICT_PL ] || exit 1

# check source file
if [ x"$1" = x"" ]; then
   SKKDIC_SRC=/usr/share/skk/SKK-JISYO.L
else
   [ -f $1 ] && SKKDIC_SRC=$1
fi
[ -z $SKKDIC_SRC ] && _exit 1

_make_cp932 () {
  echo -n "create cp932 dictionary ..."
  $SKK2MIGEMO_PL < $SKKDIC_SRC | $OPTIMIZE_DICT_PL | nkf -s \
    > /usr/share/cmigemo/cp932/migemo-dict
  echo "done"
}
_make_eucjp () {
  echo -n "create euc-jp dictionary ..."
  $SKK2MIGEMO_PL < $SKKDIC_SRC | $OPTIMIZE_DICT_PL | nkf -e \
    > /usr/share/cmigemo/euc-jp/migemo-dict
  echo "done"
}
_make_utf8 () {
  echo -n "create utf-8 dictionary ..."
  $SKK2MIGEMO_PL < $SKKDIC_SRC | $OPTIMIZE_DICT_PL | nkf -w \
    > /usr/share/cmigemo/utf-8/migemo-dict
  echo "done"
}

# create dictinaries...
_make_cp932
_make_eucjp
_make_utf8

exit 0