Sphinx安装笔记

 

// 下载所需文件
wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8-rc2.tar.gz
wget http://www.coreseek.com/uploads/sources/sphinx-0.98rc2.zhcn-support.patch
wget http://www.coreseek.com/uploads/sources/fix-crash-in-excerpts.patch
#wget http://www.coreseek.com/uploads/sources/coreseek_fulltext_2.5.tar.gz
wget http://www.coreseek.com/uploads/sources/mmseg-0.7.3.tar.gz

// 安装mmseg
tar xzf mmseg-0.7.3.tar.gz
cd mmseg-0.7.3
./configure –prefix=/usr/local/mmseg
make && make install

// 给sphinx打补丁
patch -p1 < ../sphinx-0.98rc2.zhcn-support.patch
patch -p1 < ../fix-crash-in-excerpts.patch

// 安装
./configure –prefix=/usr/local/sphinx –with-mysql=/usr/local/mysql-5.0.50 –with-mysql-includes=/usr/local/mysql-5.0.50/include/mysql/ –with-mysql-libs=/usr/local/mysql-5.0.50/lib/mysql –with-mmseg-includes=/usr/local/mmseg/include/mmseg –with-mmseg-libs=/usr/local/mmseg/lib


make & make install

 

如果出现编译错误 

 


Leaving directory********

 

官网解决办法:

 

In the meantime I’ve change the configuration file and set

#define USE_LIBICONV 0 in line 8179.

修改 configure 文件把 #define USE_LIBICONV 0 最后的数值由1改为0

重新编译。

 

// 生成词典
进入到mmseg的源代码目录后
cd data 然后执行
mmseg -u unigram.txt

在data下边会产生一个文件unigram.txt.uni
这个就是生成的字典 然后把字典改名为uni.lib放在可以读取的目录中即可

cp unigram.txt.uni /usr/local/sphinx/uni.lib

修改 sphinx.conf(/usr/local/sphinx/etc/sphinx.conf)配置文件加入以下:
charset_type = zh_cn.utf-8
charset_dictpath = /usr/local/sphinx/

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值