jieba.add_word('acarbose')
jieba.add_word('arb')
text = "rosiglitazone orlistat and acarbose have significant effects on the anthropometric indices in women with PCOS"
r = jieba.lcut(text.lower(), cut_all=True, HMM=False)
r = list(set(list(r)))
print(r)
jieba.add_word('arni')
text = "Further learning of the hypoglycemic mechanism of SGLT2i besides the kidney can provide a new understanding for its application in the treatment of diabetes."
r = jieba.lcut(text.lower(), cut_all=False, HMM=False)
r = list(r)
print(r)
你好! cut_all=True 模式下,添加自定义辞典 acarbose 和 arb ,会将 acarbose 这个词切分成 acarboseose
分词结果
['indices', 'women', 'anthropometric', 'arb', ' ', 'with', 'acarboseose', 'orlistat', 'rosiglitazone', 'the', 'in', 'effects', 'have', 'pcos', 'on', 'significant', 'and']
另外在 cut_all=False 模式下添加自定义辞典 arni,会将 learning 切分为 arni
分词结果
['besides', ' ', 'treatment', 'kidney', 'can', 'for', 'in', 'a', 'le', 'understanding', 'hypoglycemic', 'ng', 'arni', 'its', 'of', 'mechanism', 'application', 'provide', 'the', '.', 'sglt2i', 'new', 'diabetes', 'further']