| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # dictionary update script for cmigemo |
| 3 | # |
| 4 | set -e |
| 5 | |
| 6 | # check scripts |
| 7 | SKK2MIGEMO_PL=/usr/share/cmigemo/tools/skk2migemo.plscip-shell filesystem . . `/usr/share/cmigemo/tools/skk2migemo.pl`. |
| 8 | [scip-shell system . . `[`. -x $SKK2MIGEMO_PL ] || exit 1 |
| 9 | OPTIMIZE_DICT_PL=/usr/share/cmigemo/tools/optimize-dict.plscip-shell filesystem . . `/usr/share/cmigemo/tools/optimize-dict.pl`. |
| 10 | [scip-shell system . . `[`. -x $OPTIMIZE_DICT_PL ] || exit 1 |
| 11 | |
| 12 | # check source file |
| 13 | if [scip-shell system . . `[`. x"$1" = x"" ]; then |
| 14 | SKKDIC_SRC=/usr/share/skk/SKK-JISYO.Lscip-shell filesystem . . `/usr/share/skk/SKK-JISYO.L`. |
| 15 | else |
| 16 | [scip-shell system . . `[`. -f $1 ] && SKKDIC_SRC=$1 |
| 17 | fi |
| 18 | [scip-shell system . . `[`. -z $SKKDIC_SRC ] && _exit 1 |
| 19 | |
| 20 | _make_cp932scip-shell shell cmigemo 1:1.2+gh0.20220623-3 _make_cp932(). () { |
| 21 | echoscip-shell system . . echo. -n "create cp932 dictionary ..." |
| 22 | $SKK2MIGEMO_PL < $SKKDIC_SRC | $OPTIMIZE_DICT_PL | nkf -s \ |
| 23 | > /usr/share/cmigemo/cp932/migemo-dictscip-shell filesystem . . `/usr/share/cmigemo/cp932/migemo-dict`. |
| 24 | echoscip-shell system . . echo. "done" |
| 25 | } |
| 26 | _make_eucjpscip-shell shell cmigemo 1:1.2+gh0.20220623-3 _make_eucjp(). () { |
| 27 | echoscip-shell system . . echo. -n "create euc-jp dictionary ..." |
| 28 | $SKK2MIGEMO_PL < $SKKDIC_SRC | $OPTIMIZE_DICT_PL | nkf -e \ |
| 29 | > /usr/share/cmigemo/euc-jp/migemo-dictscip-shell filesystem . . `/usr/share/cmigemo/euc-jp/migemo-dict`. |
| 30 | echoscip-shell system . . echo. "done" |
| 31 | } |
| 32 | _make_utf8scip-shell shell cmigemo 1:1.2+gh0.20220623-3 _make_utf8(). () { |
| 33 | echoscip-shell system . . echo. -n "create utf-8 dictionary ..." |
| 34 | $SKK2MIGEMO_PL < $SKKDIC_SRC | $OPTIMIZE_DICT_PL | nkf -w \ |
| 35 | > /usr/share/cmigemo/utf-8/migemo-dictscip-shell filesystem . . `/usr/share/cmigemo/utf-8/migemo-dict`. |
| 36 | echoscip-shell system . . echo. "done" |
| 37 | } |
| 38 | |
| 39 | # create dictinaries... |
| 40 | _make_cp932scip-shell shell cmigemo 1:1.2+gh0.20220623-3 _make_cp932(). |
| 41 | _make_eucjpscip-shell shell cmigemo 1:1.2+gh0.20220623-3 _make_eucjp(). |
| 42 | _make_utf8scip-shell shell cmigemo 1:1.2+gh0.20220623-3 _make_utf8(). |
| 43 | |
| 44 | exit 0 |