2016-12-17 19:39:01 +08:00

20 lines
362 B
Ruby
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require "mmseg"
#t = Mmseg.new()
txt = "中文分词, 分词算法是一种计算机软件(a computer software)。这好像是废话!"
t = Mmseg.createSeg(".",txt)
while t.next()
print txt[t.start...t.end]
print ' '
end
50000.times {
#5.times {
t.setText(txt)
while t.next()
#print txt[t.start...t.end]
#print ' '
end
}
t=nil