看一下 mmseg4j 的分词速度如何,下载了两篇长篇小说共2.5M左右,可以到 [url]http://mmseg4j.googlecode.com/files/txt.zip[/url]。2.5M的数据,用Complex模式是 5.3秒左右,不知是快还是慢(因为没有对比),Simple 模式用了2.9秒。(AMD athlon 64 2800+ 1G内存 xp)
以上数据是在 eclipse 上运行
代码有两个版本:用Analyzer方式的和不依赖Lucene Analyzer方式的,前者比较简洁
可以到 svn 上看:[url]http://mmseg4j.googlecode.com/svn/trunk/example/com/chenlb/mmseg4j/example/[/url],源码。
命令行运行, txt 是*.txt 的目录:
M:\eclipse 3.3.2\workspace\mmseg4j>java -cp bin -Djava.ext.dirs=lib com.chenlb.mmseg4j.example.PerformanceAnalyzer txt
load dic use time=859ms
use 4921ms
simple 模式
M:\eclipse 3.3.2\workspace\mmseg4j>java -cp bin -Djava.ext.dirs=lib -Dmode=simple com.chenlb.mmseg4j.example.PerformanceAnalyzer txt
load dic use time=547ms
use 2421ms
mmseg4j 项目地址 [url]http://code.google.com/p/mmseg4j/[/url]
以上数据是在 eclipse 上运行
代码有两个版本:用Analyzer方式的和不依赖Lucene Analyzer方式的,前者比较简洁
可以到 svn 上看:[url]http://mmseg4j.googlecode.com/svn/trunk/example/com/chenlb/mmseg4j/example/[/url],源码。
命令行运行, txt 是*.txt 的目录:
M:\eclipse 3.3.2\workspace\mmseg4j>java -cp bin -Djava.ext.dirs=lib com.chenlb.mmseg4j.example.PerformanceAnalyzer txt
load dic use time=859ms
use 4921ms
simple 模式
M:\eclipse 3.3.2\workspace\mmseg4j>java -cp bin -Djava.ext.dirs=lib -Dmode=simple com.chenlb.mmseg4j.example.PerformanceAnalyzer txt
load dic use time=547ms
use 2421ms
mmseg4j 项目地址 [url]http://code.google.com/p/mmseg4j/[/url]