python过滤敏感词

题目:敏感词文本文件 filtered_words.txt,当用户输入敏感词语,则用 星号 * 替换,例如当用户输入「北京是个好城市」,则变成「**是个好城市」 代码:python #coding=utf-8 def filterwords(x): with open(x,'r') as f: text=f.read() print text.split('\n')
相关文章
相关标签/搜索