var filterWord={ words:"", tblRoot:{}, //敏感词文件 file:"sensitiveWords.txt", //载入敏感词组 load:function (file,callback) { file=file||this.file; var objHttp; if (window.ActiveXObject) { objHttp = new ActiveXObject("Microsoft.XMLHTTP"
敏感词文件内容: 代码: def filtered_words(path='filtered_words.txt'): words = [] with open(path, 'r', encoding='utf-8', newline='') as f: for line in f: words.append(line.strip()) return words def main(): words = filtered_words() while True: #注意 python3中input相