37,743
社区成员
发帖
与我相关
我的任务
分享
怎么解决呀 T T 菜菜鸟求指点 谢谢亲们!
In [3]: import mmseg
In [4]: dir(mmseg)
Out[4]:
['Algorithm',
'Dictionary',
'Token',
'_Dictionary',
'__builtins__',
'__doc__',
'__file__',
'__name__',
'__package__',
'__path__',
'_mmseg',
'dict_load_defaults',
'os']
In [5]: mmseg.dict_load_defaults()
In [6]: text = "to day"
In [7]: algor = mmseg.Algorithm(text)
In [8]: for tok in algor:
...: print tok.text, tok.start, tok.end
...:
to 0 2
day 3 6
In [9]: