CENT_Namazu
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#contents();
*** [[DARTS (Double-ARray Trie System):http://chasen.org/...
- DATRTS は辞書検索用の C++ ライブラリー
-- Darts は, Double-Array [Aoe 1989]を構築するための シン...
-- ハッシュのような単純な辞書として使うことも可能ですが, ...
-- 2003年7月現在, Darts は, MeCab, ChaSen に採用されてい...
- version used = 0.2 (&color(red){ ChaSen と組み合わせる...
- &ref(darts-0.2.tar.gz,center,ソース); からビルドする
[root@spirit Downloads]# ls -l darts*
-rw-r--r-- 1 root root 237927 5月 2 14:28 darts-0.2.t...
-rw-r--r-- 1 root root 245615 5月 2 11:21 darts-0.3.t...
[root@spirit Downloads]# tar xzvf darts-0.2.tar.gz
[root@spirit Downloads]# cd darts-0.2
[root@spirit darts-0.2]# ./configure
[root@spirit darts-0.2]# make
[root@spirit darts-0.2]# make check
[root@spirit darts-0.2]# make install
- プログラムから下記 darts.h をインクルードして利用する
[root@spirit darts-0.3]# ls -l /usr/local/include/darts.h
-rw-r--r-- 1 root root 13385 5月 2 11:29 /usr/local/i...
*** [[libiconv:http://www.gnu.org/software/libiconv/]] の...
- version = 1.10
- [[GNU miller:ftp://tron.um.u-tokyo.ac.jp/pub/GNU/libico...
- [[森山 将之氏のホームページ:http://www2d.biglobe.ne.jp/...
[root@spirit Downloads]# ls -l libiconv-1.10*
-rw-r--r-- 1 root root 234616 5月 2 13:00 libiconv-...
-rw-r--r-- 1 root root 3954075 5月 2 12:26 libiconv-...
[root@spirit Downloads]# tar xvzf libiconv-1.10.tar.gz
[root@spirit Downloads]# cd libiconv-1.10
[root@spirit libiconv-1.10]# gzip -dc ../libiconv-1.10-j...
[root@spirit libiconv-1.10]# ./configure --prefix=/usr/l...
[root@spirit libiconv-1.10]# make
[root@spirit libiconv-1.10]# make install
- /etc/ld.so.conf に /usr/local/lib を追加し ldconfig -v ...
[root@spirit libiconv-1.10]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
- インストールの確認
[root@spirit libiconv-1.10]# iconv -l | grep -- -MS
EUC-JP-MS EUCJP-MS EUCJP-OPEN EUCJP-WIN EUCJPMS
CP932 MS932 SHIFFT_JIS-MS SJIS-MS SJIS-OPEN SJIS-WIN WIN...
WINDOWS-932 CSWINDOWS31J
CP50221 ISO-2022-JP-MS MS50221 WINDOWS-50221
*** [[茶筌(ChaSen):http://chasen.naist.jp/hiki/ChaSen/]] ...
- 茶筌は、自然文を解析して「それ以上分割できない最小の文...
- 茶筌は、プログラム(ChaSen)と辞書(ipadic)に分けて配布さ...
- version used = 2.3.3
- &ref(chasen-2.3.3.tar.gz,center,ソース); からビルドする
-- darts のヘッダーファイルの位置、libiconv の位置を明示...
[root@spirit Downloads]# ls -l chasen*
-rw-r--r-- 1 root root 425981 5月 2 11:47 cha...
[root@spirit Downloads]# tar xvzf chasen-2.3.3.tar.gz
[root@spirit Downloads]# cd chasen-2.3.3
- &color(red){GCC 3.4.x の厳密なキャストチェックに対応す...
(const char*)keys[size] = key.data();
↓
keys[size] = const_cast<char*>(key.data());
[root@spirit chasen-2.3.3]# ./configure --with-darts=/us...
[root@spirit chasen-2.3.3]# make
[root@spirit chasen-2.3.3]# make check
[root@spirit chasen-2.3.3]# make install
*** [[Text::ChaSen:http://www.daionet.gr.jp/~knok/chasen/...
- Text::ChaSenは、奈良先端科学技術大学が開発した日本語形...
- Namazu は実行時に KAKASHI または CHASEN の Perl モジュ...
checking for Text::Kakasi perl module... no
checking for kakasi... /usr/local/bin/kakasi
checking for Text::ChaSen perl module... no
checking for chasen... /usr/local/bin/chasen
- Version = 1.03
- &ref(Text-ChaSen-1.03.tar.gz,center,Perl ソース) を利...
[root@spirit Downloads]# tar xzvf Text-ChaSen-1.03.tar.gz
[root@spirit Downloads]# cd Text-ChaSen-1.03
- ソースを展開して &color(red){Makefile.PL に2つの修正};...
-- 'LIBS' => ['-lchasen'] の内容が書かれている行を libch...
-- ChaSen 2.3.x 以降より、ChaSen 側で C++ template libray...
[root@spirit Text-ChaSen-1.03]# ls -l /usr/local/lib/lib...
-rw-r--r-- 1 root root 444774 5月 3 03:07 /usr/local/...
'LIBS' => ['-L/usr/local/lib -lchasen -lstdc++'] ← Make...
- makefile を生成して make、make install を実行
[root@spirit Text-ChaSen-1.03]# perl Makefile.PL
[root@spirit Text-ChaSen-1.03]# make
[root@spirit Text-ChaSen-1.03]# make install
*** 辞書(ipadic) のインストール [#pc900fa9]
- 茶筌が利用する &ref(ipadic-2.7.0.tar.gz,center,辞書デ...
[root@spirit Downloads]# tar xzvf ipadic-2.7.0.tar.gz
[root@spirit Downloads]# cd ipadic-2.7.0
[root@spirit ipadic-2.7.0]# ./configure
[root@spirit ipadic-2.7.0]# make
- make が終わった時点で 辞書データを UTF-8 化
-- nkf を利用した &ref(utf8conv.sh,center,スクリプト); で...
[root@spirit ipadic-2.7.0]# ./utf8conv.sh *.dic
[root@spirit ipadic-2.7.0]# ./utf8conv.sh *.cha
- UTF-8 対応の辞書ファイルの生成
[root@spirit ipadic-2.7.0]# `chasen-config --mkchadic`/m...
[root@spirit ipadic-2.7.0]# `chasen-config --mkchadic`/m...
- ipadic のインストール
[root@spirit ipadic-2.7.0]# make install
- インストール結果の確認 ( /usr/local/lib/chasen/dic/ipa...
[root@spirit ipadic-2.7.0]# ls -l /usr/local/lib/chasen/...
合計 31380
-rw-r--r-- 1 root root 80 5月 3 03:43 Makefile....
-rw-r--r-- 1 root root 23182 5月 3 03:43 cforms.cha
-rw-r--r-- 1 root root 11430416 5月 3 03:43 chadic.da
-rw-r--r-- 1 root root 12296252 5月 3 03:43 chadic.dat
-rw-r--r-- 1 root root 5852016 5月 3 03:43 chadic.lex
-rw-r--r-- 1 root root 2080 5月 3 03:43 chasenrc
-rw-r--r-- 1 root root 2218448 5月 3 03:43 connect.cha
-rw-r--r-- 1 root root 2442 5月 3 03:43 ctypes.cha
-rw-r--r-- 1 root root 1623 5月 3 03:43 grammar.cha
-rw-r--r-- 1 root root 78398 5月 3 03:43 matrix.cha
-rw-r--r-- 1 root root 144103 5月 3 03:43 table.cha
- /usr/local/etc/chasenrc の UTF-8 化
[root@spirit ipadic-2.7.0]# nkf --utf8 /usr/local/etc/ch...
[root@spirit ipadic-2.7.0]# mv /usr/local/etc/chasenrc /...
[root@spirit ipadic-2.7.0]# mv /usr/local/etc/chasenrc_u...
[root@spirit ipadic-2.7.0]# ls -l /usr/local/etc/
合計 16
-rw-r--r-- 1 root root 2325 5月 3 03:58 chasenrc
-rw-r--r-- 1 root root 2080 5月 3 03:43 chasenrc_orig
drwxr-xr-x 2 root root 4096 1月 22 18:27 mknmz
drwxr-xr-x 2 root root 4096 1月 22 17:29 namazu
- 茶筌 実行時には chasenrc で変換した文法ファイルと辞書を...
chasen -i w UTF8.txt
- 動作確認 (成功!)
[root@spirit ipadic-2.7.0]# echo "今回は「日本語」を扱う...
今回 コンカイ 今回 名詞-副詞可能
は ハ は 助詞-係助詞
「 「 「 記号-括弧開
日本語 ニホンゴ 日本語 名詞-一般
」 」 」 記号-括弧閉
を ヲ を 助詞-格助詞-一般
扱う アツカウ 扱う 動詞-自立 五段・ワ...
上 ウエ 上 名詞-非自立-副詞可能
で デ で 助詞-格助詞-一般
欠か カカ 欠く 動詞-自立 五段・カ行イ音便...
せ セ せる 動詞-接尾 一段 未然形
ない ナイ ない 助動詞 特殊・ナイ 基本形
ツール ツール ツール 名詞-一般
を ヲ を 助詞-格助詞-一般
紹介 ショウカイ 紹介 名詞-サ変接続
しよ シヨ する 動詞-自立 サ変・スル ...
う ウ う 助動詞 不変化型 基本形
。 。 。 記号-句点
EOS
[root@spirit ipadic-2.7.0]#
*** Namazu インストールの準備 [#xfc0ca20]
- 必要なソフトウエア が正しく入っているか ? (PATH の確...
-- perl → -ーwith-perl5=PATH でパスを明示的に指定する必要...
[root@spirit namazu-2.0.14]# perl -v
This is perl, v5.8.5 built for i386-linux-thread-multi
[root@spirit namazu-2.0.14]# which perl
/usr/bin/perl
-- nkf
[root@spirit namazu-2.0.14]# nkf -V
Network Kanji Filter Version 2.0.5 (2005-04-10)
[root@spirit namazu-2.0.14]# which nkf
/usr/bin/nkf
-- chasen
[root@spirit namazu-2.0.14]# chasen -V
ChaSen version 2.3.3 (c) 1996-2001 Nara Institute of Sci...
[root@spirit namazu-2.0.14]# which chasen
/usr/local/bin/chasen
-- Text::ChaSen ( Text::ChaSen の make install ログより )
→ --with-pmdir=PATH で明示的に指定する必要がある
[root@spirit Text-ChaSen-1.03]# make install
Files found in blib/arch: installing files in blib/lib i...
Writing /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread...
Appending installation info to /usr/lib/perl5/5.8.5/i386...
*** %%[[Namazu:http://www.namazu.org/]] のインストール%% ...
- &color(red){2006-11 に Namazu の再インストールを行った...
- &ref(namazu-2.0.14.tar.gz,center,ソース); 展開
[root@spirit Downloads]# tar xzvf namazu-2.0.14.tar.gz
[root@spirit Downloads]# cd namazu-2.0.14
- File-MMagic のインストール
[root@spirit namazu-2.0.14]# cd File-MMagic/
[root@spirit File-MMagic]# perl Makefile.PL
[root@spirit File-MMagic]# make
[root@spirit File-MMagic]# make install
*** Namazu の再インストール [#t63b2d35]
- [[ Crimson Snow の Namazu の設定:http://www.crimson-sno...
*** Namazu 関連ファイルのインストールディレクトリ [#i6624...
- プログラム本体 ⇒ &color(blue){/usr/bin/namazu};
[root@spirit ~]# which namazu
/usr/local/bin/namazu
- Namazu 関連ファイル ⇒ &color(blue){/usr/local/share/nam...
[root@spirit ~]# ls -l /usr/local/share/namazu/
合計 20
drwxr-xr-x 4 root root 4096 11月 19 02:32 doc
drwxr-xr-x 2 root root 4096 11月 19 02:33 etc
drwxr-xr-x 2 root root 4096 11月 19 02:32 filter
drwxr-xr-x 2 root root 4096 11月 19 02:33 pl
drwxr-xr-x 2 root root 4096 11月 19 02:33 template
- 各種フィルター ⇒ &color(blue){/usr/local/share/namazu/f...
[root@spirit ~]# ls -l /usr/local/share/namazu/filter
合計 188
-rw-r--r-- 1 root root 2089 11月 19 02:32 apachecache.pl
-rw-r--r-- 1 root root 1975 11月 19 02:32 bzip2.pl
-rw-r--r-- 1 root root 1990 11月 19 02:32 compress.pl
-rw-r--r-- 1 root root 4312 11月 19 02:32 deb.pl
-rw-r--r-- 1 root root 3095 11月 19 02:32 dvi.pl
-rw-r--r-- 1 root root 5459 11月 19 02:32 excel.pl
-rw-r--r-- 1 root root 3064 11月 19 02:32 gzip.pl
-rw-r--r-- 1 root root 6539 11月 19 02:32 hdml.pl
-rw-r--r-- 1 root root 8557 11月 19 02:32 hnf.pl
-rw-r--r-- 1 root root 10291 11月 19 02:32 html.pl
-rw-r--r-- 1 root root 2073 11月 19 02:32 macbinary.pl
-rw-r--r-- 1 root root 9458 11月 19 02:32 mailnews.pl
-rw-r--r-- 1 root root 4125 11月 19 02:32 man.pl
-rw-r--r-- 1 root root 5598 11月 19 02:32 mhonarc.pl
-rw-r--r-- 1 root root 4729 11月 19 02:32 mp3.pl
-rw-r--r-- 1 root root 5566 11月 19 02:32 msword.pl
-rw-r--r-- 1 root root 7331 11月 19 02:32 ooo.pl
-rw-r--r-- 1 root root 4495 11月 19 02:32 pdf.pl
-rw-r--r-- 1 root root 3013 11月 19 02:32 postscript.pl
-rw-r--r-- 1 root root 5279 11月 19 02:32 powerpoint.pl
-rw-r--r-- 1 root root 3154 11月 19 02:32 rfc.pl
-rw-r--r-- 1 root root 4578 11月 19 02:32 rpm.pl
-rw-r--r-- 1 root root 5047 11月 19 02:32 rtf.pl
-rw-r--r-- 1 root root 2606 11月 19 02:32 taro.pl
-rw-r--r-- 1 root root 4242 11月 19 02:32 taro56.pl
-rw-r--r-- 1 root root 5957 11月 19 02:32 taro7_10.pl
-rw-r--r-- 1 root root 2711 11月 19 02:32 tex.pl
- インデックスファイル ⇒ &color(blue){/usr/local/var/nama...
[root@spirit ~]# ls -l /usr/local/var/namazu/index/
合計 8
drwxr-xr-x 2 root root 4096 11月 19 13:07 Academia
drwxr-xr-x 2 root root 4096 11月 19 12:53 Linux
- 環境設定ファイル ⇒ &color(blue){/usr/local/etc/namazu/};
[root@spirit ~]# ls -l /usr/local/etc/namazu/
合計 20
-rw-r--r-- 1 root root 5751 11月 19 10:46 mknmzrc
-rw-r--r-- 1 root root 5551 11月 19 02:32 mknmzrc-sample
-rw-r--r-- 1 root root 2918 11月 19 02:32 namazurc-sample
*** Namazu の設定状況の確認 (mknmz -C) [#f9753d8d]
[root@spirit xpdf-japanese]# mknmz -C
読み込んだ設定ファイル: /usr/local/etc/namazu/mknmzrc
システム: linux
Namazu: 2.0.14
Perl: 5.008005
File-MMagic: 1.20
NKF: module_nkf
KAKASI: /usr/local/bin/kakasi -ieuc -oeuc -w
茶筌: module_chasen -j -F '%m '
わかち書き: /usr/local/bin/kakasi -ieuc -oeuc -w
メッセージの言語: ja_JP.eucJP
言語: ja_JP.eucJP
文字コード: euc
CONFDIR: /usr/local/etc/namazu
LIBDIR: /usr/local/share/namazu/pl
FILTERDIR: /usr/local/share/namazu/filter
TEMPLATEDIR: /usr/local/share/namazu/template
対応メディアタイプ: (22)
未対応メディアタイプ: (11) 必要ツールが $path にないもの...
- application/excel: excel.pl
application/ichitaro5: taro56.pl
application/ichitaro6: taro56.pl
- application/ichitaro7: taro7_10.pl
application/macbinary: macbinary.pl
- application/msword: msword.pl
application/pdf: pdf.pl
- application/postscript: postscript.pl
- application/powerpoint: powerpoint.pl
- application/rtf: rtf.pl
application/vnd.sun.xml.calc: ooo.pl
application/vnd.sun.xml.draw: ooo.pl
application/vnd.sun.xml.impress: ooo.pl
application/vnd.sun.xml.writer: ooo.pl
application/x-apache-cache: apachecache.pl
application/x-bzip2: bzip2.pl
application/x-compress: compress.pl
- application/x-deb: deb.pl
- application/x-dvi: dvi.pl
application/x-gzip: gzip.pl
- application/x-js-taro: taro7_10.pl
application/x-rpm: rpm.pl
- application/x-tex: tex.pl
- audio/mpeg: mp3.pl
message/news: mailnews.pl
message/rfc822: mailnews.pl
text/hnf: hnf.pl
text/html: html.pl
text/html; x-type=mhonarc: mhonarc.pl
text/plain
text/plain; x-type=rfc: rfc.pl
text/x-hdml: hdml.pl
text/x-roff: man.pl
*** powerpoint / excel / word などがエラーになっている...
|形式|filter|必要な外部操作|h
|MS Word|msword.pl|wvHtml+lv または doccat|
|MS Excel|excel.pl|xlhtml xlHtml または doccat|
|MS PowerPoint|powerpoint.pl|(ppthtml or pptHtml) + lv ま...
|一太郎|taro.pl|doccat|
|RPM|rpm.pl|rpm|
|Debian package|deb.pl|dpkg|
|TeX|tex.pl|detex|
|dvi|dvi.pl|dvi2tty+nkf|
|PDF|pdf.pl|pdftotext (xpdf)|
|PostScript|postscript.pl|ps2text or ps2ascii|
- mknmz -C とした時に、上に挙げた「必要な外部操作」が pat...
*** filter に必要な外部操作 [#l36c9eb2]
[root@spirit filter]# grep checkcmd *
bzip2.pl: $bzip2path = util::checkcmd('bzip2');
compress.pl: $zcatpath = util::checkcmd('zcat');
deb.pl: $dpkgpath = util::checkcmd('dpkg');
dvi.pl: $dviconvpath = util::checkcmd('jdvi2tt...
dvi.pl: $dviconvpath = util::checkcmd('dvi2tty...
dvi.pl: $dviconvpath = util::checkcmd('dvi2tty...
excel.pl: $wvsummarypath = util::checkcmd('wvSumma...
excel.pl: $xlconvpath = util::checkcmd('xlhtml'...
excel.pl: $utfconvpath = util::checkcmd('lv');
excel.pl: $xlconvpath = util::checkcmd('doccat');
gnumeric.pl: $gzippath = util::checkcmd('gzip');
gzip.pl: $gzippath = util::checkcmd('gzip');
koffice.pl: $unzippath = util::checkcmd('unzip');
koffice.pl: $utfconvpath = util::checkcmd('lv');
man.pl: $roffpath = util::checkcmd('jgroff');
man.pl: $roffpath = util::checkcmd('groff')...
man.pl: $roffpath = util::checkcmd('nroff')...
msword.pl: $wvsummarypath = util::checkcmd('wvSumma...
msword.pl: $wvversionpath = util::checkcmd('wvVersi...
msword.pl: $wordconvpath = util::checkcmd('wvWare');
msword.pl: $utfconvpath = util::checkcmd('lv');
msword.pl: $wordconvpath = util::checkcmd('wvHtml');
msword.pl: $utfconvpath = util::checkcmd('lv');
msword.pl: $wordconvpath = util::checkcmd('doccat');
ooo.pl: $unzippath = util::checkcmd('unzip');
ooo.pl: $utfconvpath = util::checkcmd('lv');
pdf.pl: $pdfconvpath = util::checkcmd('pdftote...
pdf.pl: $pdfinfopath = util::checkcmd('pdfinfo...
postscript.pl: $psconvpath = util::checkcmd('ps2text...
postscript.pl: $psconvpath = util::checkcmd('ps2asci...
powerpoint.pl: $wvsummarypath = util::checkcmd('wvSumma...
powerpoint.pl: $pptconvpath = util::checkcmd('ppthtml...
powerpoint.pl: $utfconvpath = util::checkcmd('lv');
powerpoint.pl: $pptconvpath = util::checkcmd('doccat');
rpm.pl: $rpmpath = util::checkcmd('rpm');
rtf.pl: $rtfconvpath = util::checkcmd('rtf2htm...
rtf.pl: $rtfconvpath = util::checkcmd('doccat');
taro.pl: $taroconvpath = util::checkcmd('doccat');
tex.pl: $texconvpath = util::checkcmd('detex');
zip.pl: $unzippath = util::checkcmd('unzip');
*** xlhtml のインストール [#xffba0f5]
- powerpoint / excel の文書解析用の pre-processor である ...
[root@spirit Downloads]# ls -ltr
-rw-r--r-- 1 root root 271045 11月 21 00:41...
[root@spirit Downloads]# tar xzvf xlhtml-0.5.tgz
[root@spirit Downloads]# cd xlhtml-0.5
[root@spirit xlhtml-0.5]# ./configure
[root@spirit xlhtml-0.5]# make
cole/Makefile.am: required file `./depcomp' not found ...
[root@spirit xlhtml-0.5]# locate depcomp ⇒ 探す
/usr/share/automake-1.7/depcomp
/usr/share/automake-1.9/depcomp
/usr/share/automake-1.6/depcomp
/usr/share/automake-1.5/depcomp
/root/Downloads/chasen-2.3.3/depcomp
/root/Downloads/ImageMagick-6.2.9/depcomp
/root/Downloads/gq-1.0beta1/depcomp
/root/Downloads/darts-0.2/depcomp
/root/Downloads/fetchmail-6.3.4/depcomp
[root@spirit xlhtml-0.5]# cp /usr/share/automake-1.9/dep...
make のやり直し
[root@spirit xlhtml-0.5]# make
[root@spirit xlhtml-0.5]# make install
- インストールの確認 (と lv がインストールされている事の...
[root@spirit xlhtml-0.5]# which xlhtml
/usr/local/bin/xlhtml
[root@spirit xlhtml-0.5]# which lv
/usr/local/bin/lv
*** [[wvware:http://wvware.sourceforge.net/]] のインスト...
- word の文書解析用の pre-processor である wvware を [[こ...
- word の文書解析用の pre-processor である xlhtml を [[こ...
[root@spirit Downloads]# ls -ltr
-rw-r--r-- 1 root root 908983 11月 21 01:15...
[root@spirit Downloads]# tar xjvf wv2-0.2.3.tar.bz2
[root@spirit Downloads]# cd wv2-0.2.3
[root@spirit wv2-0.2.3]# ./configure
wv2 depends on a modern iconv installation, supporting U...
UNICODEBIG. The detected iconv version doesn't support t...
Please get a new libiconv from http://www.gnu.org/softwa...
You might want to install the library to some alternativ...
order not to overwrite your current installation. Please...
--with-libiconv=DIR to specify the location.
iconv が古いという理由で configure がエラーになった
- 確認してみる
[root@spirit wv2-0.2.3]# which iconv
/usr/local/bin/iconv
[root@spirit wv2-0.2.3]# iconv --version
iconv (GNU libiconv 1.10)
Copyright (C) 2000-2002 Free Software Foundation, Inc.
This is free software; see the source for copying condit...
warranty; not even for MERCHANTABILITY or FITNESS FOR A ...
Written by Bruno Haible.
- libiconv 1.11 のインストール ・・・・・ &ref(libiconv-...
-- http://www.gnu.org/software/libiconv/
[root@spirit Downloads]# ls -ltr
-rw-r--r-- 1 ftproot root 4430930 11月 22 12:43...
[root@spirit Downloads]# tar xzvf libiconv-1.11.tar.gz
[root@spirit Downloads]# cd libiconv-1.11
[root@spirit libiconv-1.11]# ./configure
[root@spirit libiconv-1.11]# make
[root@spirit libiconv-1.11]# make install
- iconv (及び libiconv.so ) が更新された
[root@spirit libiconv-1.11]# which iconv
/usr/local/bin/iconv
[root@spirit libiconv-1.11]# ls -l /usr/local/bin/iconv
-rwxr-xr-x 1 root root 49448 11月 22 13:24 /usr/local/b...
- &color(red){しかし ./configure のエラーが解決しないので...
[root@spirit wv2-0.2.3]# ./configure --with-libiconv=/us...
[root@spirit wv2-0.2.3]# mak
[root@spirit wv2-0.2.3]# make install
- 改めて [[Source Forge のプロジェクト:http://sourceforge...
-- &ref(wv-1.2.4.tar.gz); と &ref(libwmf-0.2.8.4.tar.gz);...
-- wv-1.2.4 の configure で libgsf が古いと言われたので [...
- まず glib を最新版の ver 2.9.6 に更新する ⇒ &ref(glib-2...
[root@spirit glib-2.9.6]# ./configure --with-libiconv=gnu
[root@spirit glib-2.9.6]# make
[root@spirit glib-2.9.6]# make check
[root@spirit glib-2.9.6]# make install
*** 一太郎用フィルター (jt.pl) のインストール [#ba9fd1...
- mknmz -C で taro7 が未対応となっている問題を解決したか...
application/ichitaro5: taro56.pl
application/ichitaro6: taro56.pl
- application/ichitaro7: taro7_10.pl
- http://www.actv.ne.jp/~kkojima/jxwlog.html から &ref(j...
- /usr/local/share/namazu/filter にあった taro 関連フィル...
[root@spirit Downloads]# cp jt.pl /usr/local/share/namaz...
[root@spirit Downloads]# ls -l /usr/local/share/namazu/f...
-rw-r--r-- 1 root root 2606 11月 19 02:32 /usr/local/sh...
-rw-r--r-- 1 root root 4242 11月 19 02:32 /usr/local/sh...
-rw-r--r-- 1 root root 5957 11月 19 02:32 /usr/local/sh...
[root@spirit Downloads]# mv /usr/local/share/namazu/filt...
[root@spirit Downloads]# ls -l /usr/local/share/namazu/f...
ls: /usr/local/share/namazu/filter/taro*.pl: そのような...
*** インデックスの作成準備 [#t5b4380b]
- index 用のディレクトリの作成
[root@spirit ~]# ls -l /usr/local/var/namazu/index/
合計 12
drwxr-xr-x 2 root root 4096 1月 7 12:59 current_mail ...
drwxr-xr-x 2 root root 4096 1月 7 13:00 stored_mail ...
drwxr-xr-x 2 root root 4096 1月 7 12:59 document
- インデックスの作成
[root@spirit ~]# mknmz -aO /usr/local/var/namazu/index/c...
[root@spirit ~]# mknmz -aO /usr/local/var/namazu/index/s...
- 検索ページ (current_mail) ----> http://www.hmuna.com/cg...
- 検索ページ (stored_mail) -----> http://www.hmuna.com/cg...
- 検索ページ (document) -------> http://www.hmuna.com/cgi...
*** Webアクセス用の検索画面の設定 ⇒ /usr/local/var/namazu...
*** 設定 (本家のページからの引用) [#g98dd30d]
- [[メール、ニュース を検索する:http://www.namazu.org/doc...
-- mailnews.pl
---Mail/News のファイル、mhtml ファイルを扱う
---必需品: なし
---注意: mhtml ファイル、E-mail に添付された Base64 でエ...
---(Perl5.8では標準で組込済)。利用する際には mknmz に次の...
- [[web-cgi 画面からインデックスを選択できるようにする:ht...
Webブラウザからインデックスを選択できるようにするには NMZ...
<strong>検索対象:</strong>
<select name="idxname">
<option selected value="foo">foo</option>
<option value="bar">bar</option>
<option value="baz">baz</option>
</select>
--この例では、 foo, bar, baz の中からインデックスを選択可...
/
+ usr/
+ local/
+ var/
+ namazu/
+ index/
+ foo/
+ bar/
+ baz/
- [[web-cgi 画面で複数のインデックスを指定できるようにす...
複数のインデックスを検索するは NMZ.head に checkbox の記...
<strong>対象インデックス</strong>
<ul>
<li><input type="checkbox" name="idxname" value="f...
<li><input type="checkbox" name="idxname" value="b...
<li><input type="checkbox" name="idxname" value="b...
</ul>
--この例では foo, bar, baz から複数選択して検索できます。...
選択されたインデックスが 1つのとき
選択されたインデックスの雛形ファイルが用いられる
選択されたインデックスが複数のとき
基本インデックスの雛形ファイルが用いられる
*** 環境設定ファイルを指定して動作を確認 [#n42c13f8]
[root@spirit ~]# namazu -f /var/www/cgi-bin/.namazurc -C
読み込んだ設定ファイル: /usr/local/etc/namazu/namazurc
読み込んだ設定ファイル: /var/www/cgi-bin/.namazurc
--
インデックス (Index): /var/www/html/namazu/index/wiki...
ログの記録 (Logging): on
使用する言語 (Lang): ja_JP.eucJP
スコア計算 (Scoring): tfidf
テンプレート (Template): /var/www/html/namazu/index/wiki...
ヒット件数の上限 (MaxHit): 10000
マッチする語の上限 (MaxMatch): 1000
強調タグ (EmphasisTags): <strong class="keyword"> ...
置換 (Replace): /var/www/html/htdocs/ http://www.hmuna...
置換 (Replace): /usr/local/share/namazu/doc https://...
置換 (Replace): /var/www/html/pukiwiki/ https://wiki.hmu...
----
*** %%試行錯誤%% [#h81e6fb1]
- &color(red){Namazu の再インストールに伴い茶筅は使わなく...
- darts 0.3 は chasen 2.3.2 との相性が悪い → 0.3 でメソ...
dartsdic.cpp:71: error: 'class Darts::DoubleArrayImpl<ch...
*** [[xdoc2 (バイナリからのテキスト抽出エンジン):http://w...
- 殆どのバイナリ文書ファイルからテキストを抽出できます。...
- ちなみに、wine と組み合わせて、Linux で動かすなんてこと...
*** 参考 Web [#lfef91be]
- http://www.namazu.org/
- http://pcweb.mycom.co.jp/column/yetanother/045/
- http://tempest.dcnblog.jp/blog/2005/11/centos_42_namaz_...
- http://nais.to/~yto/clog/2006-02-24-3.html
- http://www.asahi-net.or.jp/~wv7y-kmr/memo/namazu.html
- [[Namazu 2.0 入門:http://www.ki.nu/software/namazu/tuto...
- [[xdoc2text を利用した MS-WORD 用フィルター:http://www....
- [[Word 用フィルターエンジン(wvware):http://wvware.sourc...
終了行:
#contents();
*** [[DARTS (Double-ARray Trie System):http://chasen.org/...
- DATRTS は辞書検索用の C++ ライブラリー
-- Darts は, Double-Array [Aoe 1989]を構築するための シン...
-- ハッシュのような単純な辞書として使うことも可能ですが, ...
-- 2003年7月現在, Darts は, MeCab, ChaSen に採用されてい...
- version used = 0.2 (&color(red){ ChaSen と組み合わせる...
- &ref(darts-0.2.tar.gz,center,ソース); からビルドする
[root@spirit Downloads]# ls -l darts*
-rw-r--r-- 1 root root 237927 5月 2 14:28 darts-0.2.t...
-rw-r--r-- 1 root root 245615 5月 2 11:21 darts-0.3.t...
[root@spirit Downloads]# tar xzvf darts-0.2.tar.gz
[root@spirit Downloads]# cd darts-0.2
[root@spirit darts-0.2]# ./configure
[root@spirit darts-0.2]# make
[root@spirit darts-0.2]# make check
[root@spirit darts-0.2]# make install
- プログラムから下記 darts.h をインクルードして利用する
[root@spirit darts-0.3]# ls -l /usr/local/include/darts.h
-rw-r--r-- 1 root root 13385 5月 2 11:29 /usr/local/i...
*** [[libiconv:http://www.gnu.org/software/libiconv/]] の...
- version = 1.10
- [[GNU miller:ftp://tron.um.u-tokyo.ac.jp/pub/GNU/libico...
- [[森山 将之氏のホームページ:http://www2d.biglobe.ne.jp/...
[root@spirit Downloads]# ls -l libiconv-1.10*
-rw-r--r-- 1 root root 234616 5月 2 13:00 libiconv-...
-rw-r--r-- 1 root root 3954075 5月 2 12:26 libiconv-...
[root@spirit Downloads]# tar xvzf libiconv-1.10.tar.gz
[root@spirit Downloads]# cd libiconv-1.10
[root@spirit libiconv-1.10]# gzip -dc ../libiconv-1.10-j...
[root@spirit libiconv-1.10]# ./configure --prefix=/usr/l...
[root@spirit libiconv-1.10]# make
[root@spirit libiconv-1.10]# make install
- /etc/ld.so.conf に /usr/local/lib を追加し ldconfig -v ...
[root@spirit libiconv-1.10]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
- インストールの確認
[root@spirit libiconv-1.10]# iconv -l | grep -- -MS
EUC-JP-MS EUCJP-MS EUCJP-OPEN EUCJP-WIN EUCJPMS
CP932 MS932 SHIFFT_JIS-MS SJIS-MS SJIS-OPEN SJIS-WIN WIN...
WINDOWS-932 CSWINDOWS31J
CP50221 ISO-2022-JP-MS MS50221 WINDOWS-50221
*** [[茶筌(ChaSen):http://chasen.naist.jp/hiki/ChaSen/]] ...
- 茶筌は、自然文を解析して「それ以上分割できない最小の文...
- 茶筌は、プログラム(ChaSen)と辞書(ipadic)に分けて配布さ...
- version used = 2.3.3
- &ref(chasen-2.3.3.tar.gz,center,ソース); からビルドする
-- darts のヘッダーファイルの位置、libiconv の位置を明示...
[root@spirit Downloads]# ls -l chasen*
-rw-r--r-- 1 root root 425981 5月 2 11:47 cha...
[root@spirit Downloads]# tar xvzf chasen-2.3.3.tar.gz
[root@spirit Downloads]# cd chasen-2.3.3
- &color(red){GCC 3.4.x の厳密なキャストチェックに対応す...
(const char*)keys[size] = key.data();
↓
keys[size] = const_cast<char*>(key.data());
[root@spirit chasen-2.3.3]# ./configure --with-darts=/us...
[root@spirit chasen-2.3.3]# make
[root@spirit chasen-2.3.3]# make check
[root@spirit chasen-2.3.3]# make install
*** [[Text::ChaSen:http://www.daionet.gr.jp/~knok/chasen/...
- Text::ChaSenは、奈良先端科学技術大学が開発した日本語形...
- Namazu は実行時に KAKASHI または CHASEN の Perl モジュ...
checking for Text::Kakasi perl module... no
checking for kakasi... /usr/local/bin/kakasi
checking for Text::ChaSen perl module... no
checking for chasen... /usr/local/bin/chasen
- Version = 1.03
- &ref(Text-ChaSen-1.03.tar.gz,center,Perl ソース) を利...
[root@spirit Downloads]# tar xzvf Text-ChaSen-1.03.tar.gz
[root@spirit Downloads]# cd Text-ChaSen-1.03
- ソースを展開して &color(red){Makefile.PL に2つの修正};...
-- 'LIBS' => ['-lchasen'] の内容が書かれている行を libch...
-- ChaSen 2.3.x 以降より、ChaSen 側で C++ template libray...
[root@spirit Text-ChaSen-1.03]# ls -l /usr/local/lib/lib...
-rw-r--r-- 1 root root 444774 5月 3 03:07 /usr/local/...
'LIBS' => ['-L/usr/local/lib -lchasen -lstdc++'] ← Make...
- makefile を生成して make、make install を実行
[root@spirit Text-ChaSen-1.03]# perl Makefile.PL
[root@spirit Text-ChaSen-1.03]# make
[root@spirit Text-ChaSen-1.03]# make install
*** 辞書(ipadic) のインストール [#pc900fa9]
- 茶筌が利用する &ref(ipadic-2.7.0.tar.gz,center,辞書デ...
[root@spirit Downloads]# tar xzvf ipadic-2.7.0.tar.gz
[root@spirit Downloads]# cd ipadic-2.7.0
[root@spirit ipadic-2.7.0]# ./configure
[root@spirit ipadic-2.7.0]# make
- make が終わった時点で 辞書データを UTF-8 化
-- nkf を利用した &ref(utf8conv.sh,center,スクリプト); で...
[root@spirit ipadic-2.7.0]# ./utf8conv.sh *.dic
[root@spirit ipadic-2.7.0]# ./utf8conv.sh *.cha
- UTF-8 対応の辞書ファイルの生成
[root@spirit ipadic-2.7.0]# `chasen-config --mkchadic`/m...
[root@spirit ipadic-2.7.0]# `chasen-config --mkchadic`/m...
- ipadic のインストール
[root@spirit ipadic-2.7.0]# make install
- インストール結果の確認 ( /usr/local/lib/chasen/dic/ipa...
[root@spirit ipadic-2.7.0]# ls -l /usr/local/lib/chasen/...
合計 31380
-rw-r--r-- 1 root root 80 5月 3 03:43 Makefile....
-rw-r--r-- 1 root root 23182 5月 3 03:43 cforms.cha
-rw-r--r-- 1 root root 11430416 5月 3 03:43 chadic.da
-rw-r--r-- 1 root root 12296252 5月 3 03:43 chadic.dat
-rw-r--r-- 1 root root 5852016 5月 3 03:43 chadic.lex
-rw-r--r-- 1 root root 2080 5月 3 03:43 chasenrc
-rw-r--r-- 1 root root 2218448 5月 3 03:43 connect.cha
-rw-r--r-- 1 root root 2442 5月 3 03:43 ctypes.cha
-rw-r--r-- 1 root root 1623 5月 3 03:43 grammar.cha
-rw-r--r-- 1 root root 78398 5月 3 03:43 matrix.cha
-rw-r--r-- 1 root root 144103 5月 3 03:43 table.cha
- /usr/local/etc/chasenrc の UTF-8 化
[root@spirit ipadic-2.7.0]# nkf --utf8 /usr/local/etc/ch...
[root@spirit ipadic-2.7.0]# mv /usr/local/etc/chasenrc /...
[root@spirit ipadic-2.7.0]# mv /usr/local/etc/chasenrc_u...
[root@spirit ipadic-2.7.0]# ls -l /usr/local/etc/
合計 16
-rw-r--r-- 1 root root 2325 5月 3 03:58 chasenrc
-rw-r--r-- 1 root root 2080 5月 3 03:43 chasenrc_orig
drwxr-xr-x 2 root root 4096 1月 22 18:27 mknmz
drwxr-xr-x 2 root root 4096 1月 22 17:29 namazu
- 茶筌 実行時には chasenrc で変換した文法ファイルと辞書を...
chasen -i w UTF8.txt
- 動作確認 (成功!)
[root@spirit ipadic-2.7.0]# echo "今回は「日本語」を扱う...
今回 コンカイ 今回 名詞-副詞可能
は ハ は 助詞-係助詞
「 「 「 記号-括弧開
日本語 ニホンゴ 日本語 名詞-一般
」 」 」 記号-括弧閉
を ヲ を 助詞-格助詞-一般
扱う アツカウ 扱う 動詞-自立 五段・ワ...
上 ウエ 上 名詞-非自立-副詞可能
で デ で 助詞-格助詞-一般
欠か カカ 欠く 動詞-自立 五段・カ行イ音便...
せ セ せる 動詞-接尾 一段 未然形
ない ナイ ない 助動詞 特殊・ナイ 基本形
ツール ツール ツール 名詞-一般
を ヲ を 助詞-格助詞-一般
紹介 ショウカイ 紹介 名詞-サ変接続
しよ シヨ する 動詞-自立 サ変・スル ...
う ウ う 助動詞 不変化型 基本形
。 。 。 記号-句点
EOS
[root@spirit ipadic-2.7.0]#
*** Namazu インストールの準備 [#xfc0ca20]
- 必要なソフトウエア が正しく入っているか ? (PATH の確...
-- perl → -ーwith-perl5=PATH でパスを明示的に指定する必要...
[root@spirit namazu-2.0.14]# perl -v
This is perl, v5.8.5 built for i386-linux-thread-multi
[root@spirit namazu-2.0.14]# which perl
/usr/bin/perl
-- nkf
[root@spirit namazu-2.0.14]# nkf -V
Network Kanji Filter Version 2.0.5 (2005-04-10)
[root@spirit namazu-2.0.14]# which nkf
/usr/bin/nkf
-- chasen
[root@spirit namazu-2.0.14]# chasen -V
ChaSen version 2.3.3 (c) 1996-2001 Nara Institute of Sci...
[root@spirit namazu-2.0.14]# which chasen
/usr/local/bin/chasen
-- Text::ChaSen ( Text::ChaSen の make install ログより )
→ --with-pmdir=PATH で明示的に指定する必要がある
[root@spirit Text-ChaSen-1.03]# make install
Files found in blib/arch: installing files in blib/lib i...
Writing /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread...
Appending installation info to /usr/lib/perl5/5.8.5/i386...
*** %%[[Namazu:http://www.namazu.org/]] のインストール%% ...
- &color(red){2006-11 に Namazu の再インストールを行った...
- &ref(namazu-2.0.14.tar.gz,center,ソース); 展開
[root@spirit Downloads]# tar xzvf namazu-2.0.14.tar.gz
[root@spirit Downloads]# cd namazu-2.0.14
- File-MMagic のインストール
[root@spirit namazu-2.0.14]# cd File-MMagic/
[root@spirit File-MMagic]# perl Makefile.PL
[root@spirit File-MMagic]# make
[root@spirit File-MMagic]# make install
*** Namazu の再インストール [#t63b2d35]
- [[ Crimson Snow の Namazu の設定:http://www.crimson-sno...
*** Namazu 関連ファイルのインストールディレクトリ [#i6624...
- プログラム本体 ⇒ &color(blue){/usr/bin/namazu};
[root@spirit ~]# which namazu
/usr/local/bin/namazu
- Namazu 関連ファイル ⇒ &color(blue){/usr/local/share/nam...
[root@spirit ~]# ls -l /usr/local/share/namazu/
合計 20
drwxr-xr-x 4 root root 4096 11月 19 02:32 doc
drwxr-xr-x 2 root root 4096 11月 19 02:33 etc
drwxr-xr-x 2 root root 4096 11月 19 02:32 filter
drwxr-xr-x 2 root root 4096 11月 19 02:33 pl
drwxr-xr-x 2 root root 4096 11月 19 02:33 template
- 各種フィルター ⇒ &color(blue){/usr/local/share/namazu/f...
[root@spirit ~]# ls -l /usr/local/share/namazu/filter
合計 188
-rw-r--r-- 1 root root 2089 11月 19 02:32 apachecache.pl
-rw-r--r-- 1 root root 1975 11月 19 02:32 bzip2.pl
-rw-r--r-- 1 root root 1990 11月 19 02:32 compress.pl
-rw-r--r-- 1 root root 4312 11月 19 02:32 deb.pl
-rw-r--r-- 1 root root 3095 11月 19 02:32 dvi.pl
-rw-r--r-- 1 root root 5459 11月 19 02:32 excel.pl
-rw-r--r-- 1 root root 3064 11月 19 02:32 gzip.pl
-rw-r--r-- 1 root root 6539 11月 19 02:32 hdml.pl
-rw-r--r-- 1 root root 8557 11月 19 02:32 hnf.pl
-rw-r--r-- 1 root root 10291 11月 19 02:32 html.pl
-rw-r--r-- 1 root root 2073 11月 19 02:32 macbinary.pl
-rw-r--r-- 1 root root 9458 11月 19 02:32 mailnews.pl
-rw-r--r-- 1 root root 4125 11月 19 02:32 man.pl
-rw-r--r-- 1 root root 5598 11月 19 02:32 mhonarc.pl
-rw-r--r-- 1 root root 4729 11月 19 02:32 mp3.pl
-rw-r--r-- 1 root root 5566 11月 19 02:32 msword.pl
-rw-r--r-- 1 root root 7331 11月 19 02:32 ooo.pl
-rw-r--r-- 1 root root 4495 11月 19 02:32 pdf.pl
-rw-r--r-- 1 root root 3013 11月 19 02:32 postscript.pl
-rw-r--r-- 1 root root 5279 11月 19 02:32 powerpoint.pl
-rw-r--r-- 1 root root 3154 11月 19 02:32 rfc.pl
-rw-r--r-- 1 root root 4578 11月 19 02:32 rpm.pl
-rw-r--r-- 1 root root 5047 11月 19 02:32 rtf.pl
-rw-r--r-- 1 root root 2606 11月 19 02:32 taro.pl
-rw-r--r-- 1 root root 4242 11月 19 02:32 taro56.pl
-rw-r--r-- 1 root root 5957 11月 19 02:32 taro7_10.pl
-rw-r--r-- 1 root root 2711 11月 19 02:32 tex.pl
- インデックスファイル ⇒ &color(blue){/usr/local/var/nama...
[root@spirit ~]# ls -l /usr/local/var/namazu/index/
合計 8
drwxr-xr-x 2 root root 4096 11月 19 13:07 Academia
drwxr-xr-x 2 root root 4096 11月 19 12:53 Linux
- 環境設定ファイル ⇒ &color(blue){/usr/local/etc/namazu/};
[root@spirit ~]# ls -l /usr/local/etc/namazu/
合計 20
-rw-r--r-- 1 root root 5751 11月 19 10:46 mknmzrc
-rw-r--r-- 1 root root 5551 11月 19 02:32 mknmzrc-sample
-rw-r--r-- 1 root root 2918 11月 19 02:32 namazurc-sample
*** Namazu の設定状況の確認 (mknmz -C) [#f9753d8d]
[root@spirit xpdf-japanese]# mknmz -C
読み込んだ設定ファイル: /usr/local/etc/namazu/mknmzrc
システム: linux
Namazu: 2.0.14
Perl: 5.008005
File-MMagic: 1.20
NKF: module_nkf
KAKASI: /usr/local/bin/kakasi -ieuc -oeuc -w
茶筌: module_chasen -j -F '%m '
わかち書き: /usr/local/bin/kakasi -ieuc -oeuc -w
メッセージの言語: ja_JP.eucJP
言語: ja_JP.eucJP
文字コード: euc
CONFDIR: /usr/local/etc/namazu
LIBDIR: /usr/local/share/namazu/pl
FILTERDIR: /usr/local/share/namazu/filter
TEMPLATEDIR: /usr/local/share/namazu/template
対応メディアタイプ: (22)
未対応メディアタイプ: (11) 必要ツールが $path にないもの...
- application/excel: excel.pl
application/ichitaro5: taro56.pl
application/ichitaro6: taro56.pl
- application/ichitaro7: taro7_10.pl
application/macbinary: macbinary.pl
- application/msword: msword.pl
application/pdf: pdf.pl
- application/postscript: postscript.pl
- application/powerpoint: powerpoint.pl
- application/rtf: rtf.pl
application/vnd.sun.xml.calc: ooo.pl
application/vnd.sun.xml.draw: ooo.pl
application/vnd.sun.xml.impress: ooo.pl
application/vnd.sun.xml.writer: ooo.pl
application/x-apache-cache: apachecache.pl
application/x-bzip2: bzip2.pl
application/x-compress: compress.pl
- application/x-deb: deb.pl
- application/x-dvi: dvi.pl
application/x-gzip: gzip.pl
- application/x-js-taro: taro7_10.pl
application/x-rpm: rpm.pl
- application/x-tex: tex.pl
- audio/mpeg: mp3.pl
message/news: mailnews.pl
message/rfc822: mailnews.pl
text/hnf: hnf.pl
text/html: html.pl
text/html; x-type=mhonarc: mhonarc.pl
text/plain
text/plain; x-type=rfc: rfc.pl
text/x-hdml: hdml.pl
text/x-roff: man.pl
*** powerpoint / excel / word などがエラーになっている...
|形式|filter|必要な外部操作|h
|MS Word|msword.pl|wvHtml+lv または doccat|
|MS Excel|excel.pl|xlhtml xlHtml または doccat|
|MS PowerPoint|powerpoint.pl|(ppthtml or pptHtml) + lv ま...
|一太郎|taro.pl|doccat|
|RPM|rpm.pl|rpm|
|Debian package|deb.pl|dpkg|
|TeX|tex.pl|detex|
|dvi|dvi.pl|dvi2tty+nkf|
|PDF|pdf.pl|pdftotext (xpdf)|
|PostScript|postscript.pl|ps2text or ps2ascii|
- mknmz -C とした時に、上に挙げた「必要な外部操作」が pat...
*** filter に必要な外部操作 [#l36c9eb2]
[root@spirit filter]# grep checkcmd *
bzip2.pl: $bzip2path = util::checkcmd('bzip2');
compress.pl: $zcatpath = util::checkcmd('zcat');
deb.pl: $dpkgpath = util::checkcmd('dpkg');
dvi.pl: $dviconvpath = util::checkcmd('jdvi2tt...
dvi.pl: $dviconvpath = util::checkcmd('dvi2tty...
dvi.pl: $dviconvpath = util::checkcmd('dvi2tty...
excel.pl: $wvsummarypath = util::checkcmd('wvSumma...
excel.pl: $xlconvpath = util::checkcmd('xlhtml'...
excel.pl: $utfconvpath = util::checkcmd('lv');
excel.pl: $xlconvpath = util::checkcmd('doccat');
gnumeric.pl: $gzippath = util::checkcmd('gzip');
gzip.pl: $gzippath = util::checkcmd('gzip');
koffice.pl: $unzippath = util::checkcmd('unzip');
koffice.pl: $utfconvpath = util::checkcmd('lv');
man.pl: $roffpath = util::checkcmd('jgroff');
man.pl: $roffpath = util::checkcmd('groff')...
man.pl: $roffpath = util::checkcmd('nroff')...
msword.pl: $wvsummarypath = util::checkcmd('wvSumma...
msword.pl: $wvversionpath = util::checkcmd('wvVersi...
msword.pl: $wordconvpath = util::checkcmd('wvWare');
msword.pl: $utfconvpath = util::checkcmd('lv');
msword.pl: $wordconvpath = util::checkcmd('wvHtml');
msword.pl: $utfconvpath = util::checkcmd('lv');
msword.pl: $wordconvpath = util::checkcmd('doccat');
ooo.pl: $unzippath = util::checkcmd('unzip');
ooo.pl: $utfconvpath = util::checkcmd('lv');
pdf.pl: $pdfconvpath = util::checkcmd('pdftote...
pdf.pl: $pdfinfopath = util::checkcmd('pdfinfo...
postscript.pl: $psconvpath = util::checkcmd('ps2text...
postscript.pl: $psconvpath = util::checkcmd('ps2asci...
powerpoint.pl: $wvsummarypath = util::checkcmd('wvSumma...
powerpoint.pl: $pptconvpath = util::checkcmd('ppthtml...
powerpoint.pl: $utfconvpath = util::checkcmd('lv');
powerpoint.pl: $pptconvpath = util::checkcmd('doccat');
rpm.pl: $rpmpath = util::checkcmd('rpm');
rtf.pl: $rtfconvpath = util::checkcmd('rtf2htm...
rtf.pl: $rtfconvpath = util::checkcmd('doccat');
taro.pl: $taroconvpath = util::checkcmd('doccat');
tex.pl: $texconvpath = util::checkcmd('detex');
zip.pl: $unzippath = util::checkcmd('unzip');
*** xlhtml のインストール [#xffba0f5]
- powerpoint / excel の文書解析用の pre-processor である ...
[root@spirit Downloads]# ls -ltr
-rw-r--r-- 1 root root 271045 11月 21 00:41...
[root@spirit Downloads]# tar xzvf xlhtml-0.5.tgz
[root@spirit Downloads]# cd xlhtml-0.5
[root@spirit xlhtml-0.5]# ./configure
[root@spirit xlhtml-0.5]# make
cole/Makefile.am: required file `./depcomp' not found ...
[root@spirit xlhtml-0.5]# locate depcomp ⇒ 探す
/usr/share/automake-1.7/depcomp
/usr/share/automake-1.9/depcomp
/usr/share/automake-1.6/depcomp
/usr/share/automake-1.5/depcomp
/root/Downloads/chasen-2.3.3/depcomp
/root/Downloads/ImageMagick-6.2.9/depcomp
/root/Downloads/gq-1.0beta1/depcomp
/root/Downloads/darts-0.2/depcomp
/root/Downloads/fetchmail-6.3.4/depcomp
[root@spirit xlhtml-0.5]# cp /usr/share/automake-1.9/dep...
make のやり直し
[root@spirit xlhtml-0.5]# make
[root@spirit xlhtml-0.5]# make install
- インストールの確認 (と lv がインストールされている事の...
[root@spirit xlhtml-0.5]# which xlhtml
/usr/local/bin/xlhtml
[root@spirit xlhtml-0.5]# which lv
/usr/local/bin/lv
*** [[wvware:http://wvware.sourceforge.net/]] のインスト...
- word の文書解析用の pre-processor である wvware を [[こ...
- word の文書解析用の pre-processor である xlhtml を [[こ...
[root@spirit Downloads]# ls -ltr
-rw-r--r-- 1 root root 908983 11月 21 01:15...
[root@spirit Downloads]# tar xjvf wv2-0.2.3.tar.bz2
[root@spirit Downloads]# cd wv2-0.2.3
[root@spirit wv2-0.2.3]# ./configure
wv2 depends on a modern iconv installation, supporting U...
UNICODEBIG. The detected iconv version doesn't support t...
Please get a new libiconv from http://www.gnu.org/softwa...
You might want to install the library to some alternativ...
order not to overwrite your current installation. Please...
--with-libiconv=DIR to specify the location.
iconv が古いという理由で configure がエラーになった
- 確認してみる
[root@spirit wv2-0.2.3]# which iconv
/usr/local/bin/iconv
[root@spirit wv2-0.2.3]# iconv --version
iconv (GNU libiconv 1.10)
Copyright (C) 2000-2002 Free Software Foundation, Inc.
This is free software; see the source for copying condit...
warranty; not even for MERCHANTABILITY or FITNESS FOR A ...
Written by Bruno Haible.
- libiconv 1.11 のインストール ・・・・・ &ref(libiconv-...
-- http://www.gnu.org/software/libiconv/
[root@spirit Downloads]# ls -ltr
-rw-r--r-- 1 ftproot root 4430930 11月 22 12:43...
[root@spirit Downloads]# tar xzvf libiconv-1.11.tar.gz
[root@spirit Downloads]# cd libiconv-1.11
[root@spirit libiconv-1.11]# ./configure
[root@spirit libiconv-1.11]# make
[root@spirit libiconv-1.11]# make install
- iconv (及び libiconv.so ) が更新された
[root@spirit libiconv-1.11]# which iconv
/usr/local/bin/iconv
[root@spirit libiconv-1.11]# ls -l /usr/local/bin/iconv
-rwxr-xr-x 1 root root 49448 11月 22 13:24 /usr/local/b...
- &color(red){しかし ./configure のエラーが解決しないので...
[root@spirit wv2-0.2.3]# ./configure --with-libiconv=/us...
[root@spirit wv2-0.2.3]# mak
[root@spirit wv2-0.2.3]# make install
- 改めて [[Source Forge のプロジェクト:http://sourceforge...
-- &ref(wv-1.2.4.tar.gz); と &ref(libwmf-0.2.8.4.tar.gz);...
-- wv-1.2.4 の configure で libgsf が古いと言われたので [...
- まず glib を最新版の ver 2.9.6 に更新する ⇒ &ref(glib-2...
[root@spirit glib-2.9.6]# ./configure --with-libiconv=gnu
[root@spirit glib-2.9.6]# make
[root@spirit glib-2.9.6]# make check
[root@spirit glib-2.9.6]# make install
*** 一太郎用フィルター (jt.pl) のインストール [#ba9fd1...
- mknmz -C で taro7 が未対応となっている問題を解決したか...
application/ichitaro5: taro56.pl
application/ichitaro6: taro56.pl
- application/ichitaro7: taro7_10.pl
- http://www.actv.ne.jp/~kkojima/jxwlog.html から &ref(j...
- /usr/local/share/namazu/filter にあった taro 関連フィル...
[root@spirit Downloads]# cp jt.pl /usr/local/share/namaz...
[root@spirit Downloads]# ls -l /usr/local/share/namazu/f...
-rw-r--r-- 1 root root 2606 11月 19 02:32 /usr/local/sh...
-rw-r--r-- 1 root root 4242 11月 19 02:32 /usr/local/sh...
-rw-r--r-- 1 root root 5957 11月 19 02:32 /usr/local/sh...
[root@spirit Downloads]# mv /usr/local/share/namazu/filt...
[root@spirit Downloads]# ls -l /usr/local/share/namazu/f...
ls: /usr/local/share/namazu/filter/taro*.pl: そのような...
*** インデックスの作成準備 [#t5b4380b]
- index 用のディレクトリの作成
[root@spirit ~]# ls -l /usr/local/var/namazu/index/
合計 12
drwxr-xr-x 2 root root 4096 1月 7 12:59 current_mail ...
drwxr-xr-x 2 root root 4096 1月 7 13:00 stored_mail ...
drwxr-xr-x 2 root root 4096 1月 7 12:59 document
- インデックスの作成
[root@spirit ~]# mknmz -aO /usr/local/var/namazu/index/c...
[root@spirit ~]# mknmz -aO /usr/local/var/namazu/index/s...
- 検索ページ (current_mail) ----> http://www.hmuna.com/cg...
- 検索ページ (stored_mail) -----> http://www.hmuna.com/cg...
- 検索ページ (document) -------> http://www.hmuna.com/cgi...
*** Webアクセス用の検索画面の設定 ⇒ /usr/local/var/namazu...
*** 設定 (本家のページからの引用) [#g98dd30d]
- [[メール、ニュース を検索する:http://www.namazu.org/doc...
-- mailnews.pl
---Mail/News のファイル、mhtml ファイルを扱う
---必需品: なし
---注意: mhtml ファイル、E-mail に添付された Base64 でエ...
---(Perl5.8では標準で組込済)。利用する際には mknmz に次の...
- [[web-cgi 画面からインデックスを選択できるようにする:ht...
Webブラウザからインデックスを選択できるようにするには NMZ...
<strong>検索対象:</strong>
<select name="idxname">
<option selected value="foo">foo</option>
<option value="bar">bar</option>
<option value="baz">baz</option>
</select>
--この例では、 foo, bar, baz の中からインデックスを選択可...
/
+ usr/
+ local/
+ var/
+ namazu/
+ index/
+ foo/
+ bar/
+ baz/
- [[web-cgi 画面で複数のインデックスを指定できるようにす...
複数のインデックスを検索するは NMZ.head に checkbox の記...
<strong>対象インデックス</strong>
<ul>
<li><input type="checkbox" name="idxname" value="f...
<li><input type="checkbox" name="idxname" value="b...
<li><input type="checkbox" name="idxname" value="b...
</ul>
--この例では foo, bar, baz から複数選択して検索できます。...
選択されたインデックスが 1つのとき
選択されたインデックスの雛形ファイルが用いられる
選択されたインデックスが複数のとき
基本インデックスの雛形ファイルが用いられる
*** 環境設定ファイルを指定して動作を確認 [#n42c13f8]
[root@spirit ~]# namazu -f /var/www/cgi-bin/.namazurc -C
読み込んだ設定ファイル: /usr/local/etc/namazu/namazurc
読み込んだ設定ファイル: /var/www/cgi-bin/.namazurc
--
インデックス (Index): /var/www/html/namazu/index/wiki...
ログの記録 (Logging): on
使用する言語 (Lang): ja_JP.eucJP
スコア計算 (Scoring): tfidf
テンプレート (Template): /var/www/html/namazu/index/wiki...
ヒット件数の上限 (MaxHit): 10000
マッチする語の上限 (MaxMatch): 1000
強調タグ (EmphasisTags): <strong class="keyword"> ...
置換 (Replace): /var/www/html/htdocs/ http://www.hmuna...
置換 (Replace): /usr/local/share/namazu/doc https://...
置換 (Replace): /var/www/html/pukiwiki/ https://wiki.hmu...
----
*** %%試行錯誤%% [#h81e6fb1]
- &color(red){Namazu の再インストールに伴い茶筅は使わなく...
- darts 0.3 は chasen 2.3.2 との相性が悪い → 0.3 でメソ...
dartsdic.cpp:71: error: 'class Darts::DoubleArrayImpl<ch...
*** [[xdoc2 (バイナリからのテキスト抽出エンジン):http://w...
- 殆どのバイナリ文書ファイルからテキストを抽出できます。...
- ちなみに、wine と組み合わせて、Linux で動かすなんてこと...
*** 参考 Web [#lfef91be]
- http://www.namazu.org/
- http://pcweb.mycom.co.jp/column/yetanother/045/
- http://tempest.dcnblog.jp/blog/2005/11/centos_42_namaz_...
- http://nais.to/~yto/clog/2006-02-24-3.html
- http://www.asahi-net.or.jp/~wv7y-kmr/memo/namazu.html
- [[Namazu 2.0 入門:http://www.ki.nu/software/namazu/tuto...
- [[xdoc2text を利用した MS-WORD 用フィルター:http://www....
- [[Word 用フィルターエンジン(wvware):http://wvware.sourc...
ページ名: