var fs = require('fs'); var readline = require('readline'); // 敏感词树 var root = {};
var start_time = newDate(); // 添加敏感词 functionaddWord(word) { if (word == null || word.length == 0) return; var wordArray = Array.from(word); var wordLen = wordArray.length - 1; var current = root; for (var i in wordArray) { if (current[wordArray[i]] == null) { current[wordArray[i]] = {}; } current = current[wordArray[i]]; if (i == wordLen) { current["END"] = 1; } } }