更新于 2014-12-01 16:20:49 UEANER

Linux 下安装 LibMMSeg

$ wget http://www.coreseek.cn/uploads/csft/3.2/mmseg-3.2.14.tar.gz

$ sudo tar xf mmseg-3.2.14.tar.gz -C /usr/local/src/
$ cd /usr/local/src/mmseg-3.2.14/
$ ./bootstrap    ##输出的warning信息可以忽略,如果出现error则需要解决
$ ./configure --prefix=/usr/local/mmseg3
$ make
$ sudo make install

测试:

$ /usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc src/t1.txt
中文/x 分/x 词/x 测试/x 
中国人/x 上海市/x 

Word Splite took: 0 ms.

OS X 下安装 LibMMSeg

需要先安装 Homebrew

$ wget https://raw.githubusercontent.com/Homebrew/homebrew/9c7802270aabf638654ea0bccecc592e04785f87/Library/Formula/mmseg.rb -O/usr/local/Library/Formula/mmseg.rb

$ brew install mmseg

测试:

$ echo "今天有人请吃饭" > /tmp/test.txt
$ /usr/local/Cellar/mmseg/3.2.15/bin/mmseg -d /usr/local/Cellar/mmseg/3.2.15/etc /tmp/test.txt
今天/x 有人/x 请/x 吃饭/x

Word Splite took: 1 ms.

参考

http://www.coreseek.cn/opensource/mmseg/
http://www.coreseek.cn/products-install/install_on_bsd_linux/
http://www.coreseek.cn/products-install/install_on_macosx/
https://github.com/zzdhidden/mmseg-node#libmmseg-on-mac-os
https://github.com/Homebrew/homebrew/pull/31659/files#r16405455
https://github.com/RobinQu/mmseg/
转载请注明出处。
本文地址:http://blog.aboutc.net/linux/70/install-mmseg-on-linux-or-osx

评论:0

关闭高亮高亮 分享到新浪微博分享到新浪微博