拼接可以使用 join
# encoding=utf-8
import jieba
keywords = []
seg_list = jieba.cut("打不开", cut_all=False)
for i in seg_list:
keywords.append(i)
if len(keywords) >= 3:
keywords = str.join(keywords)
print(keywords)
得到结果
➜ Downloads python3 test.py
Building prefix dict from the default dictionary ...
Loading model from cache /var/folders/v1/slqlcj696z9cpj31tbwzyly00000gn/T/jieba.cache
Loading model cost 0.982 seconds.
Prefix dict has been built succesfully.
['打不开']