Sphinx安装笔记

    技术2022-05-19  38

     

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

    // 安装mmsegtar xzf mmseg-0.7.3.tar.gzcd mmseg-0.7.3./configure –prefix=/usr/local/mmsegmake && make install

    // 给sphinx打补丁patch -p1 < ../sphinx-0.98rc2.zhcn-support.patchpatch -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-8charset_dictpath = /usr/local/sphinx/

     


    最新回复(0)