Denbun POP version Manual
User's Manual | Administrator's Manual | Installation Guide | Initial Settings Guide
Back to Menu
 

Installing and configuring database search engine (MeCab)

MeCab is an open source morphological analysis engine developed through a project "Kyoto University and NTT Corporation".
Please refer the MeCab web site (http://mecab.sourceforge.net/) for more information about.

Please refer the system requirements for which version of MeCab that Denbun supports.
1. Expanding the package
Expand the file you transferred by FTP. In this example, it assumes that the file exists in "/home/guest" directory.

[root@xxxxxx guest]# cd /usr/local/src
[root@xxxxxx src]# tar xvzf /home/guest/mecab-0.97.tar.gz

After the expansion, a directory named "mecab-0.97" is created in "/usr/local/src".
2. Install the package
To configure the package, use configure scripts.
Specify UTF-8 as a character set.
Move to the directory you expand the package and run the configure script.
[root@xxxxxx src]# cd /usr/local/src/mecab-0.97/
[root@xxxxxx mecab-0.97]# ./configure --with-charset=utf8
      .
      .(Omitted)
      .
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default commands
[root@xxxxxx mecab-0.97]#


Make the package.
User GNU make to make the package.
[root@xxxxxx mecab-0.97]# gmake
      .
      .(Omitted)
      .
gmake[2]: Entering directory `/usr/local/src/mecab-0.97'.
gmake[2]: Nothing to be done for `all-am'.
gmake[2]: Leaving directory `/usr/local/src/mecab-0.97'.
gmake[1]: Leaving directory `/usr/local/src/mecab-0.97'.
[root@xxxxxx mecab-0.97]#


Now, it is ready to install the package. This step requires the super user (root).
[root@xxxxxx mecab-0.97]# gmake install
      .
      .(Omitted)
      .
 /usr/bin/install -c -m 644 'mecabrc' '/usr/local/etc/mecabrc'
gmake[2]: Leaving directory `/usr/local/src/mecab-0.97'.
gmake[1]: Leaving directory `/usr/local/src/mecab-0.97'.
[root@xxxxxx mecab-0.97]#


After the checking the installation, use gmake clean command to cleaning. This command deletes unnecessary files and makes free space.
[root@xxxxxx mecab-0.97]# gmake clean
3. Create a link of the library
Since MeCab library is installed in "/usr/local/lib", create a symbolic link in "/usr/lib".

 

[root@xxxxxx mecab-0.97]# ln -s /usr/local/lib/libmecab.so.1.0.0 /usr/lib/libmecab.so
[root@xxxxxx mecab-0.97]# ln -s /usr/local/lib/libmecab.so.1.0.0 /usr/lib/libmecab.so.1
[root@xxxxxx mecab-0.97]# ls -la /usr/lib/libmecab*
lrwxrwxrwx 1 root root 32 Feb 16 12:57 AM /usr/lib/libmecab.so -> /usr/local/lib/libmecab.so
.1.0.0

lrwxrwxrwx 1 root root 32 Feb 16 12:57 AM /usr/lib/libmecab.so.1 -> /usr/local/lib/libmecab.
so.1.0.0

[root@xxxxxx mecab-0.97]#
Install a dictionary for MeCab

4. Expand the package source
Expand the file you transferred by FTP. In this example, it assumes that the file exists in "/home/guest" directory.

 

[root@xxxxxx mecab-0.97]# cd /usr/local/src
[root@xxxxxx src]# tar xvzf /home/guest/mecab-ipadic-2.7.0-20070801.tar.gz


After the expansion, a directory named "mecab-ipadic-2.7.0-20070801" is created in "/usr/local/src".
5. Install the package
To configure the package, use configure scripts.
Specify UTF-8 as a character set.
Move to the directory you expand the package and run the configure script.

[root@xxxxxx src]# cd /usr/local/src/mecab-ipadic-2.7.0-20070801
[root@xxxxxx mecab-ipadic-2.7.0-20070801]# ./configure --with-charset=utf8
      .
      .(Omitted)
      .
checking for mecab-config... /usr/local/bin/mecab-config
configure: creating ./config.status
config.status: creating Makefile
[root@xxxxxx mecab-ipadic-2.7.0-20070801]#


Make the package.
User GNU make to make the package.
[root@xxxxxx mecab-ipadic-2.7.0-20070801]# gmake
      .
      .(Omitted)
      .
done!
echo To enable dictionary, rewrite /usr/local/etc/mecabrc as \"dicrc = /usr/local/lib/mecab/dic/ipadic\"
To enable dictionary, rewrite /usr/local/etc/mecabrc as "dicrc = /usr/local/lib/mecab/dic/ipadic"
[root@xxxxxx mecab-ipadic-2.7.0-20070801]#


Now, it is ready to install the package. This step requires the super user (root).
[root@xxxxxx mecab-ipadic-2.7.0-20070801]# gmake install
      .
      .(Omitted)
      .
 /usr/bin/install -c -m 644 ./pos-id.def /usr/local/lib/mecab/dic/ipadic/pos-id.def
 /usr/bin/install -c -m 644 ./dicrc /usr/local/lib/mecab/dic/ipadic/dicrc
gmake[1]: Leaving directory `/usr/local/src/mecab-ipadic-2.7.0-20070801'.
[root@xxxxxx mecab-ipadic-2.7.0-20070801]#


After the checking the installation, use gmake clean command to cleaning. This command deletes unnecessary files and makes free space.
[root@xxxxxx mecab-ipadic-2.7.0-20070801]# gmake clean

 
Copyright (C) 2008-2011 NEOJAPAN,Inc. All Rights Reserved.