def delstopwords(content):
result=''
words = jieba.lcut(content)
return_words = []
for w in words:
if w not in app.config['stopwords']:
result += w.encode('utf-8') # +"/"+str(w.flag)+" " #????
return_words.append(w.encode('utf-8'))
# words = pseg.lcut(content)
# with app.test_request_context():
# for word, flag in words:
# if (word not in app.config['stopwords'] and flag not in ["/x","/zg","/uj","/ul","/e","/d","/uz","/y"]): #??????????????????
# result += word.encode('utf-8') # +"/"+str(w.flag)+" " #????
# print result
return result,return_words
评论列表
文章目录