UJP - 技術情報1

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

形態素解析システム茶筌の導入

形態素解析システム茶筌の導入


0.改訂履歴

  • 2005.08.03 新規作成
  • 2006.12.25 誤字修正

1.はじめに

 このドキュメントでは形態素解析システムの茶筌を導入し,利用してみるまでの手順を説明する.

 茶筌を利用する為には,Darts:Double-ARray Trie Systemを必要とするので,それも同時にインストールを行う.なお,環境はRedHat ES3.0である.

2.環境の確認

  • 今回導入しようとしているシステムの環境を調べる.
[root@testweb root]$ uname -a
Linux testweb 2.4.21-9.ELsmp #1 SMP Thu Jan 8 17:08:56 EST 2004 i686 i686
 i386 GNU/Linux
[root@testweb root]$ cat /etc/redhat-release 
Red Hat Enterprise Linux ES release 3 (Taroon Update 1)
[root@testweb root]$ 

3.Dartsモジュールの入手とインストール

  • DartsのWebページは下記である.
  • 今回入手したのはdarts-0.2.tar.gzである.
  • ファイルを展開し,ディレクリに移動してインストールを行う.
[root@testweb darts-0.2]$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C++ preprocessor... g++ -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for off_t... yes
checking for size_t... yes
checking for char... yes
checking size of char... 1
checking for short... yes
checking size of short... 2
checking for int... yes
checking size of int... 4
checking for long... yes
checking size of long... 4
checking for long long... yes
checking size of long long... 8
checking if g++ supports stl <vector> (required)... yes
checking if g++ supports stl <cstdio> (required)... yes
checking if g++ supports stl <cstring> (required)... yes
checking if g++ supports stl <string> (required)... yes
checking if g++ supports namespaces (required) ... yes
checking if g++ uses std namespace ... yes
checking if g++ environment provides all required features... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzopen in -lz... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tests/Makefile
config.status: creating darts.h
config.status: creating darts.spec
config.status: creating config.h
config.status: executing depfiles commands
[root@testweb darts-0.2]$ make
make  all-recursive
make[1]: Entering directory `/usr/local/bin/darts-0.2'
Making all in tests
make[2]: Entering directory `/usr/local/bin/darts-0.2/tests'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/bin/darts-0.2/tests'
make[2]: Entering directory `/usr/local/bin/darts-0.2'
source='mkdarts.cpp' object='mkdarts.o' libtool=no \
depfile='.deps/mkdarts.Po' tmpdepfile='.deps/mkdarts.TPo' \
depmode=gcc3 /bin/sh ./depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I.     -O3 -Wall -c -o mkdarts.o `test -f
 'mkdarts.cpp' || echo './'`mkdarts.cpp
g++  -O3 -Wall   -o mkdarts  mkdarts.o  -lz 
source='darts.cpp' object='darts.o' libtool=no \
depfile='.deps/darts.Po' tmpdepfile='.deps/darts.TPo' \
depmode=gcc3 /bin/sh ./depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I.     -O3 -Wall -c -o darts.o `test -f 
'darts.cpp' || echo './'`darts.cpp
g++  -O3 -Wall   -o darts  darts.o  -lz 
make[2]: Leaving directory `/usr/local/bin/darts-0.2'
make[1]: Leaving directory `/usr/local/bin/darts-0.2'
[root@testweb darts-0.2]$ make check
Making check in tests
make[1]: Entering directory `/usr/local/bin/darts-0.2/tests'
make  check-TESTS
make[2]: Entering directory `/usr/local/bin/darts-0.2/tests'
Making Double Array: 100% |*******************************************| 
Done!, Compression Ratio: 94.5065 %
Checking ... 
PASS: test1.sh
==================
All 1 tests passed
==================
make[2]: Leaving directory `/usr/local/bin/darts-0.2/tests'
make[1]: Leaving directory `/usr/local/bin/darts-0.2/tests'
make[1]: Entering directory `/usr/local/bin/darts-0.2'
make[1]: Nothing to be done for `check-am'.
make[1]: Leaving directory `/usr/local/bin/darts-0.2'
[root@testweb darts-0.2]$ 
  • 環境がそろっていれば,特に問題なくmakeができている.
  • インストールを行う.
[root@testweb darts-0.2]# make install
Making install in tests
make[1]: Entering directory `/usr/local/bin/darts-0.2/tests'
make[2]: Entering directory `/usr/local/bin/darts-0.2/tests'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/usr/local/bin/darts-0.2/tests'
make[1]: Leaving directory `/usr/local/bin/darts-0.2/tests'
make[1]: Entering directory `/usr/local/bin/darts-0.2'
make[2]: Entering directory `/usr/local/bin/darts-0.2'
/bin/sh ./mkinstalldirs /usr/local/libexec/darts
  /usr/bin/install -c mkdarts /usr/local/libexec/darts/mkdarts
  /usr/bin/install -c darts /usr/local/libexec/darts/darts
/bin/sh ./mkinstalldirs /usr/local/include
 /usr/bin/install -c -m 644 darts.h /usr/local/include/darts.h
make[2]: Leaving directory `/usr/local/bin/darts-0.2'
make[1]: Leaving directory `/usr/local/bin/darts-0.2'
[root@testweb darts-0.2]#
  • インストール後,ヘッダファイルを確認する.
[root@testweb darts-0.2]# ls -la /usr/local/include/darts.h 
-rw-r--r--    1 root     root        12355 Jul  4 15:10 /usr/local/include/darts.h
[root@testweb darts-0.2]#

4.chasenのモジュールの入手とインストール

  • chasenモジュールは以下から入手できる.
  • 今回利用したのはchasen-2.3.3.tar.gzである.
  • インストール時には,インストール先ディレクトリを/usr/local/chasenとし,先ほどインストールしたDartsのパスを指定して実行する.
[root@testweb chasen-2.3.3]# ./configure --prefix=/usr/local/chasen 
--with-darts=/usr/local/include
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking whether to enable maintainer-specific portions of Makefiles...
 no
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... pass_all
checking command to parse /usr/bin/nm -B output... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (/usr/bin/ld) supports shared libraries...
 yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether -lc should be explicitly linked in... no
creating libtool
checking for strerror in -lcposix... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets ${MAKE}... (cached) yes
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking for sys/stat.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/types.h... (cached) yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for darts.h... yes
checking for iconv in -liconv... no
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking iconv args... EUC-JP SHIFT_JIS ISO-8859-1
checking for off_t... yes
checking for size_t... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating chasen-config
config.status: creating chasen/Makefile
config.status: creating mkchadic/Makefile
config.status: creating doc/Makefile
config.status: creating lib/Makefile
config.status: creating tests/Makefile
config.status: creating chasen.spec
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing default commands
[root@testweb chasen-2.3.3]#       
  • 問題ないので,インストールを行う.
[root@testweb chasen-2.3.3]# make install
Making install in doc
make[1]: Entering directory `/root/chasen/chasen-2.3.3/doc'
make[2]: Entering directory `/root/chasen/chasen-2.3.3/doc'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/chasen/chasen-2.3.3/doc'
make[1]: Leaving directory `/root/chasen/chasen-2.3.3/doc'
Making install in lib
make[1]: Entering directory `/root/chasen/chasen-2.3.3/lib'
make[2]: Entering directory `/root/chasen/chasen-2.3.3/lib'
/bin/sh ../mkinstalldirs /usr/local/chasen/lib
mkdir -p -- /usr/local/chasen/lib
 /bin/sh ../libtool --mode=install /usr/bin/install -c  libchasen.la
 /usr/local/chasen/lib/libchasen.la
/usr/bin/install -c .libs/libchasen.so.0.0.1 
/usr/local/chasen/lib/libchasen.so.0.0.1
(cd /usr/local/chasen/lib && rm -f libchasen.so.0 && ln -s
 libchasen.so.0.0.1 libchasen.so.0)
(cd /usr/local/chasen/lib && rm -f libchasen.so && ln -s
 libchasen.so.0.0.1 libchasen.so)
/usr/bin/install -c .libs/libchasen.lai /usr/local/chasen/lib/libchasen.la
/usr/bin/install -c .libs/libchasen.a /usr/local/chasen/lib/libchasen.a
ranlib /usr/local/chasen/lib/libchasen.a
chmod 644 /usr/local/chasen/lib/libchasen.a
libtool: install: warning: remember to run `libtool --finish /home/cl-
chan/lib'
/bin/sh ../mkinstalldirs /usr/local/chasen/include
mkdir -p -- /usr/local/chasen/include
 /usr/bin/install -c -m 644 chasen.h /usr/local/chasen/include/chasen.h
make[2]: Leaving directory `/root/chasen/chasen-2.3.3/lib'
make[1]: Leaving directory `/root/chasen/chasen-2.3.3/lib'
Making install in chasen
make[1]: Entering directory `/root/chasen/chasen-2.3.3/chasen'
make[2]: Entering directory `/root/chasen/chasen-2.3.3/chasen'
/bin/sh ../mkinstalldirs /usr/local/chasen/bin
mkdir -p -- /usr/local/chasen/bin
  /bin/sh ../libtool --mode=install /usr/bin/install -c chasen 
/usr/local/chasen/bin/chasen/usr/bin/install -c .libs/chasen 
/usr/local/chasen/bin/chasen
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/chasen/chasen-2.3.3/chasen'
make[1]: Leaving directory `/root/chasen/chasen-2.3.3/chasen'
Making install in mkchadic
make[1]: Entering directory `/root/chasen/chasen-2.3.3/mkchadic'
make[2]: Entering directory `/root/chasen/chasen-2.3.3/mkchadic'
/bin/sh ../mkinstalldirs /usr/local/chasen/libexec/chasen
mkdir -p -- /usr/local/chasen/libexec/chasen
  /bin/sh ../libtool --mode=install /usr/bin/install -c makemat
 /usr/local/chasen/libexec/chasen/makemat
/usr/bin/install -c .libs/makemat
/usr/local/chasen/libexec/chasen/makemat
  /bin/sh ../libtool --mode=install /usr/bin/install -c makeda
 /usr/local/chasen/libexec/chasen/makeda
/usr/bin/install -c .libs/makeda /usr/local/chasen/libexec/chasen/makeda
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/chasen/chasen-2.3.3/mkchadic'
make[1]: Leaving directory `/root/chasen/chasen-2.3.3/mkchadic'
Making install in tests
make[1]: Entering directory `/root/chasen/chasen-2.3.3/tests'
make[2]: Entering directory `/root/chasen/chasen-2.3.3/tests'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/chasen/chasen-2.3.3/tests'
make[1]: Leaving directory `/root/chasen/chasen-2.3.3/tests'
make[1]: Entering directory `/root/chasen/chasen-2.3.3'
make[2]: Entering directory `/root/chasen/chasen-2.3.3'
/bin/sh ./mkinstalldirs /usr/local/chasen/bin
 /usr/bin/install -c chasen-config /usr/local/chasen/bin/chasen-config
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/chasen/chasen-2.3.3'
make[1]: Leaving directory `/root/chasen/chasen-2.3.3'
[root@testweb chasen-2.3.3]#                                                               
  • これでインストール終了.

5.辞書の入手とインストール

  • chasenを利用するには辞書が必要なので,インストールする.
  • 辞書はchasenと同じページで入手できる.
  • 今回は,ipadic-2.7.0.tar.gz を利用した.
  • chasenをインストールしたディレクトリを指定しながら,configureを行う.
[root@testweb ipadic-2.4.4]# ./configure --with-chasen-config=
/usr/local/chasen/bin/chasen-config --with-dicdir=/usr/local/chasen
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking whether to enable maintainer-specific portions of Makefiles...
 no
checking for a BSD compatible install... /usr/bin/install -c
checking whether make sets ${MAKE}... (cached) yes
using /usr/local/chasen for dicdir
using /usr/local/chasen/bin/chasen-config for chasen-config
creating ./config.status
creating Makefile
creating chasenrc
creating ipadic.spec
creating doc/Makefile
[root@testweb ipadic-2.4.4]# 
  • インストールを行う.
[root@testweb ipadic-2.4.4]# make install
Making install in doc
make[1]: Entering directory `/root/ipadic-2.4.4/doc'
make[2]: Entering directory `/root/ipadic-2.4.4/doc'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ../mkinstalldirs /usr/local/info
 /usr/bin/install -c -m 644 ./ipadic-ja.info /usr/local/info/ipadic-
ja.info
 /usr/bin/install -c -m 644 ./ipadic-ja.info-1 /usr/local/info/ipadic-
ja.info-1
 /usr/bin/install -c -m 644 ./ipadic-ja.info-2 /usr/local/info/ipadic-
ja.info-2
 /usr/bin/install -c -m 644 ./ipadic-ja.info-3 /usr/local/info/ipadic-
ja.info-3
 install-info --info-dir=/usr/local/info /usr/local/info/ipadic-ja.info
make[2]: Leaving directory `/root/ipadic-2.4.4/doc'
make[1]: Leaving directory `/root/ipadic-2.4.4/doc'
make[1]: Entering directory `/root/ipadic-2.4.4'
make[2]: Entering directory `/root/ipadic-2.4.4'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ./mkinstalldirs /usr/local/chasen/ipadic
mkdir /usr/local/chasen/ipadic
 /usr/bin/install -c -m 644 ./grammar.cha /usr/local/chasen/ipadic/
grammar.cha
 /usr/bin/install -c -m 644 ./ctypes.cha /usr/local/chasen/ipadic/
ctypes.cha
 /usr/bin/install -c -m 644 ./cforms.cha /usr/local/chasen/ipadic/
cforms.cha
 /usr/bin/install -c -m 644 ./chasenrc /usr/local/chasen/ipadic/chasenrc
 /usr/bin/install -c -m 644 ./connect.cha /usr/local/chasen/ipadic/
connect.cha
 /usr/bin/install -c -m 644 ./Makefile.bat /usr/local/chasen/ipadic/
Makefile.bat
 /usr/bin/install -c -m 644 ./matrix.cha /usr/local/chasen/ipadic/
matrix.cha
 /usr/bin/install -c -m 644 ./table.cha /usr/local/chasen/ipadic/
table.cha
 /usr/bin/install -c -m 644 ./chadic.int /usr/local/chasen/ipadic/
chadic.int
 /usr/bin/install -c -m 644 ./chadic.pat /usr/local/chasen/ipadic/
chadic.pat
 /usr/bin/install -c -m 644 ./chadic.ary /usr/local/chasen/ipadic/
chadic.ary
if test -f /usr/local/chasen/etc/chasenrc  ; then \
        echo "Please modify /usr/local/chasen/etc/chasenrc"; \
else \
        cp chasenrc /usr/local/chasen/etc/chasenrc ;\
fi
cp: cannot create regular file `/usr/local/chasen/etc/chasenrc': No such 
file or directory
make[2]: *** [install-data-local] Error 1
make[2]: Leaving directory `/root/ipadic-2.4.4'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/root/ipadic-2.4.4'
make: *** [install-recursive] Error 1
[root@testweb ipadic-2.4.4]#
  • ファイルコピーが失敗してエラーになっている.
  • ディレクトリを作成する.
[root@testweb ipadic-2.4.4]# mkdir /usr/local/chasen/etc
[root@testweb ipadic-2.4.4]# 
  • rcファイルを確認して,複写する.
[root@testweb ipadic-2.4.4]# ls -la
total 30489
drwxr-xr-x    3 18001    users        2048 Aug  3 16:26 .
drwxr-xr-x   16 root     root         1024 Aug  3 11:53 ..
-rw-r--r--    1 18001    users          80 Dec  6  2000 AUTHORS
-rw-r--r--    1 18001    users      154869 Mar  3  2001 Adj.dic
-rw-r--r--    1 18001    users        8989 Feb 24  2001 Adnominal.dic
-rw-r--r--    1 18001    users      193100 Mar  3  2001 Adverb.dic
-rw-r--r--    1 18001    users        2604 Feb 24  2001 Auxil.dic
-rw-r--r--    1 18001    users        3777 Dec  6  2000 COPYING
-rw-r--r--    1 18001    users        2042 Mar 22  2001 ChangeLog
-rw-r--r--    1 18001    users       10431 Mar  3  2001 Conjunction.dic
-rw-r--r--    1 18001    users        1131 Feb 24  2001 Filler.dic
-rw-r--r--    1 18001    users        7831 Dec  6  2000 INSTALL
-rw-r--r--    1 18001    users        1157 Feb 22  2001 INSTALL-ja
-rw-r--r--    1 18001    users       14291 Feb 24  2001 Interjection.dic
-rw-r--r--    1 root     root        13405 Aug  3 16:26 Makefile
-rw-r--r--    1 18001    users        1470 Mar 22  2001 Makefile.am
-rw-r--r--    1 18001    users         751 Dec  7  2000 Makefile.bat
-rw-r--r--    1 18001    users       12636 Mar 23  2001 Makefile.in
-rw-r--r--    1 18001    users         411 Mar 20  2001 NEWS
-rw-r--r--    1 18001    users        1752 Mar 20  2001 NEWS-ja
-rw-r--r--    1 18001    users      225104 Mar  3  2001 Noun.adjv.dic
-rw-r--r--    1 18001    users       53740 Mar  3  2001 Noun.adverbal.dic
-rw-r--r--    1 18001    users        7328 Mar  3  2001 Noun.demonst.dic
-rw-r--r--    1 18001    users     3866345 Mar  3  2001 Noun.dic
-rw-r--r--    1 18001    users        3148 Feb 24  2001 Noun.nai.dic
-rw-r--r--    1 18001    users     2479608 Mar  3  2001 Noun.name.dic
-rw-r--r--    1 18001    users        2246 Feb 24  2001 Noun.number.dic
-rw-r--r--    1 18001    users     1710608 Mar  3  2001 Noun.org.dic
-rw-r--r--    1 18001    users       95634 Mar  3  2001 Noun.others.dic
-rw-r--r--    1 18001    users     5902740 Mar  3  2001 Noun.place.dic
-rw-r--r--    1 18001    users     2144764 Mar  3  2001 Noun.proper.dic
-rw-r--r--    1 18001    users      675220 Mar  3  2001 Noun.verbal.dic
-rw-r--r--    1 18001    users         172 Oct  1  2000 Others.dic
-rw-r--r--    1 18001    users       12353 Feb 24  2001 Postp.dic
-rw-r--r--    1 18001    users       13296 Mar  3  2001 Prefix.dic
-rw-r--r--    1 18001    users          30 Dec  7  2000 README
-rw-r--r--    1 18001    users       85060 Oct 28  2000 Suffix.dic
-rw-r--r--    1 18001    users        8807 Mar  3  2001 Symbol.dic
-rw-r--r--    1 18001    users     1223253 Mar  3  2001 Verb.dic
-rw-r--r--    1 18001    users        4355 Mar 23  2001 aclocal.m4
-rw-r--r--    1 18001    users       19028 Oct  1  2000 cforms.cha
-rw-r--r--    1 root     root       939532 Jul 12 18:30 chadic.ary
-rw-r--r--    1 root     root      8014698 Jul 12 18:30 chadic.int
-rw-r--r--    1 root     root      1357598 Jul 12 18:30 chadic.pat
-rw-r--r--    1 root     root          643 Aug  3 16:26 chasenrc
-rw-r--r--    1 18001    users         652 Mar  1  2001 chasenrc.in
-rw-r--r--    1 root     root          889 Jul 12 15:54 config.cache
-rw-r--r--    1 root     root          701 Aug  3 16:26 config.log
-rwxr-xr-x    1 root     root         6330 Aug  3 16:26 config.status
-rwxr-xr-x    1 18001    users       44841 Mar 23  2001 configure
-rw-r--r--    1 18001    users        2672 Mar 22  2001 configure.in
-rw-r--r--    1 18001    users     1389191 Mar  3  2001 connect.cha
-rw-r--r--    1 18001    users        1746 Oct  1  2000 ctypes.cha
drwxr-xr-x    2 18001    users        1024 Aug  3 16:26 doc
-rw-r--r--    1 18001    users        1321 Oct  1  2000 grammar.cha
-rwxr-xr-x    1 18001    users        5598 Mar 23  2001 install-sh
-rw-r--r--    1 root     root         1792 Aug  3 16:26 ipadic.spec
-rw-r--r--    1 18001    users        1799 Mar 23  2001 ipadic.spec.in
-rw-r--r--    1 root     root       114605 Jul 12 17:15 matrix.cha
-rwxr-xr-x    1 18001    users        6283 Mar 23  2001 missing
-rwxr-xr-x    1 18001    users         722 Mar 23  2001 mkinstalldirs
-rw-r--r--    1 root     root       110364 Jul 12 17:15 table.cha
[root@testweb ipadic-2.4.4]# cp chasenrc /usr/local/chasen/etc/.
[root@testweb ipadic-2.4.4]#              
  • 再度インストールを行う.
[root@testweb ipadic-2.4.4]# make install
Making install in doc
make[1]: Entering directory `/root/ipadic-2.4.4/doc'
make[2]: Entering directory `/root/ipadic-2.4.4/doc'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ../mkinstalldirs /usr/local/info
 /usr/bin/install -c -m 644 ./ipadic-ja.info /usr/local/info/ipadic-
ja.info
 /usr/bin/install -c -m 644 ./ipadic-ja.info-1 /usr/local/info/ipadic-
ja.info-1
 /usr/bin/install -c -m 644 ./ipadic-ja.info-2 /usr/local/info/ipadic-
ja.info-2
 /usr/bin/install -c -m 644 ./ipadic-ja.info-3 /usr/local/info/ipadic-
ja.info-3
 install-info --info-dir=/usr/local/info /usr/local/info/ipadic-ja.info
make[2]: Leaving directory `/root/ipadic-2.4.4/doc'
make[1]: Leaving directory `/root/ipadic-2.4.4/doc'
make[1]: Entering directory `/root/ipadic-2.4.4'
make[2]: Entering directory `/root/ipadic-2.4.4'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ./mkinstalldirs /usr/local/chasen/ipadic
 /usr/bin/install -c -m 644 ./grammar.cha /usr/local/chasen/ipadic/grammar.cha
 /usr/bin/install -c -m 644 ./ctypes.cha /usr/local/chasen/ipadic/ctypes.cha
 /usr/bin/install -c -m 644 ./cforms.cha /usr/local/chasen/ipadic/cforms.cha
 /usr/bin/install -c -m 644 ./chasenrc /usr/local/chasen/ipadic/chasenrc
 /usr/bin/install -c -m 644 ./connect.cha /usr/local/chasen/ipadic/connect.cha
 /usr/bin/install -c -m 644 ./Makefile.bat /usr/local/chasen/ipadic/Makefile.bat
 /usr/bin/install -c -m 644 ./matrix.cha /usr/local/chasen/ipadic/matrix.cha
 /usr/bin/install -c -m 644 ./table.cha /usr/local/chasen/ipadic/table.cha
 /usr/bin/install -c -m 644 ./chadic.int /usr/local/chasen/ipadic/chadic.int
 /usr/bin/install -c -m 644 ./chadic.pat /usr/local/chasen/ipadic/chadic.pat
 /usr/bin/install -c -m 644 ./chadic.ary /usr/local/chasen/ipadic/chadic.ary
if test -f /usr/local/chasen/etc/chasenrc  ; then \
        echo "Please modify /usr/local/chasen/etc/chasenrc"; \
else \
        cp chasenrc /usr/local/chasen/etc/chasenrc ;\
fi
Please modify /usr/local/chasen/etc/chasenrc
make[2]: Leaving directory `/root/ipadic-2.4.4'
make[1]: Leaving directory `/root/ipadic-2.4.4'
[root@testweb ipadic-2.4.4]# 

6.chasenを利用してみる

  • インストールしたディレクトリ以下に実行ファイルがあるので,それを呼び出す.
  • 呼び出した後は,日本語を入力してみる.
  • この時,ターミナルはEUCにしておく.
[root@testweb ipadic-2.4.4]# /usr/local/chasen/bin/chasen
貴社の記者が記者で帰社した
貴社    キシャ  貴社    名詞-一般
の      ノ      の      助詞-連体化
記者    キシャ  記者    名詞-一般
が      ガ      が      助詞-格助詞-一般
記者    キシャ  記者    名詞-一般
で      デ      で      助詞-格助詞-一般
帰社    キシャ  帰社    名詞-サ変接続

し      シ      する    動詞-自立       サ変・スル      連用形
た      タ      た      助動詞  特殊・タ        基本形
EOS

EOS
小泉純一郎は日本の総理大臣ですか?

小泉    コイズミ        小泉    名詞-固有名詞-人名-姓

純一郎  ジュンイチロウ  純一郎  名詞-固有名詞-人名-名

は      ハ      は      助詞-係助詞

日本    ニッポン        日本    名詞-固有名詞-地域-国
の      ノ      の      助詞-連体化
総理    ソウリ  総理    名詞-一般
大臣    ダイジン        大臣    名詞-一般
です    デス    です    助動詞  特殊・デス      基本形
か      カ      か      助詞-副助詞/並立助詞/終助詞

?      ?      ?      記号-一般
EOS

[root@testweb ipadic-2.4.4]#          
  • 正しく動いている事が確認できました.


広告スペース
Google