Open 1057437122 opened 3 years ago
這不就是全模式嗎,cut_all=True
這不就是全模式嗎,cut_all=True
不是哦,这是我的测试:
>>> import jieba
>>> str='苹果手机壳'
>>> a=jieba.cut(str,cut_all=True)
>>> a
<generator object Tokenizer.cut at 0x7fc25cf82ba0>
>>> ','.join(a)
Building prefix dict from the default dictionary ...
Dumping model to file cache /var/folders/qh/r_mkjfkd3lx8w5p47qjh7wtw0000gn/T/jieba.cache
Loading model cost 0.562 seconds.
Prefix dict has been built successfully.
'苹果,手机,机壳'
比如说用户的输入是:'苹果手机壳',是否可以拆分为['苹果', '苹果手机', '手机','手机壳','苹果手机壳']这样的列表?