-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·55 lines (43 loc) · 913 Bytes
/
update.sh
File metadata and controls
executable file
·55 lines (43 loc) · 913 Bytes
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
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
#
# compile JUMAN dictionaries in the specified path
#
if [ -z "$JUMAN_PREFIX" ]; then
JUMAN_PREFIX=/share/usr
fi
MAKEINT="$JUMAN_PREFIX/libexec/juman/makeint"
DICSORT="$JUMAN_PREFIX/libexec/juman/dicsort"
MKDARTS="$JUMAN_PREFIX/libexec/juman/mkdarts"
MAKEPAT="$JUMAN_PREFIX/libexec/juman/makepat"
usage () {
echo "usage: $0 -d JUMAN_SOURCE_DIC_DIR"
exit 1
}
while getopts i:d: OPT
do
case $OPT in
"d" ) dicdir=$OPTARG ;;
* )usage ;;
esac
done
if [ ! -d "$dicdir" ]; then
usage
fi
cd $dicdir
tmpfile="tmpfile_int"
rm -f $tmpfile
for dicfile in *.dic; do
echo $dicfile
intfile=${dicfile%.dic}.int
datfile=${dicfile%.dic}.dat
$MAKEINT $dicfile
cat $intfile >> $tmpfile
done
$DICSORT $tmpfile > jumandic.dat
if [ -x "$MKDARTS" ]; then
$MKDARTS jumandic.dat jumandic.da jumandic.bin
else
# older version
$MAKEPAT
fi
rm -f $tmpfile