File: utf8dict

package info (click to toggle)
ipadic 2.7.0%2Bmain-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 24,312 kB
  • sloc: sh: 570; makefile: 90
file content (40 lines) | stat: -rwxr-xr-x 1,646 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# Create utf8 dictionary data under utf8

set -e

utf8="utf8"

VERSION=$( dpkg-parsechangelog | awk '/^Version: /{print $2}' | cut -d':' -f2 | cut -d'-' -f1 | sed 's/\+\|\~/-/')
CHASEN_MKCHADIC_DIR=`chasen-config --mkchadic`

# Create UTF-8 dictionary data in ${utf8}
rm -rf ${utf8}
mkdir ${utf8}
for f in cforms.cha connect.cha ctypes.cha grammar.cha *.dic; do
	iconv -f eucjp -t utf8 -o ${utf8}/$f $f
done
# Actual recent Changelog 
cp NEWS ${utf8}/changelog
echo ""                                                                       >> ${utf8}/changelog
echo "======================================================================" >> ${utf8}/changelog
echo "===== Older ChangeLog partially in Japanese                      =====" >> ${utf8}/changelog
echo "======================================================================" >> ${utf8}/changelog
echo ""                                                                       >> ${utf8}/changelog
iconv -f eucjp -t utf8 ChangeLog >> ${utf8}/changelog

# UTF-8 /etc/chasenrc master
iconv -f eucjp -t utf8 chasenrc.in | \
sed -e "s,@CHASEN_DIC_DIR@/@PACKAGE@,/var/lib/chasen/dic/debian," \
    -e "s,@PACKAGE@,ipadic," -e "s,@VERSION@,${VERSION}," >${utf8}/ipadic.rc

# specify encoding to be UTF-8
if [ -z `grep '(ENCODE "u")' ${utf8}/ipadic.rc` ] && 
   [ -z `grep '(ENCODE "w")' ${utf8}/ipadic.rc` ]; then
    echo      '(ENCODE "u")'                                    >> ${utf8}/ipadic.rc
fi

#   for matrix.cha table.cha
(cd ${utf8} && $CHASEN_MKCHADIC_DIR/makemat -i w)
#   for chadic.da chadic.lex chadic.dat
(cd ${utf8} && $CHASEN_MKCHADIC_DIR/makeda -i w chadic *.dic)