python過濾敏感詞

題目:敏感詞文本文件 filtered_words.txt,當用戶輸入敏感詞語,則用 星號 * 替換,例如當用戶輸入「北京是個好城市」,則變成「**是個好城市」 代碼:python #coding=utf-8 def filterwords(x): with open(x,'r') as f: text=f.read() print text.split('\n')
相關文章
相關標籤/搜索