Open catBigcat opened 5 years ago
WordDictionary加载字典有如下代码(150行左右), private String addWord(String word) { if (null != word && !"".equals(word.trim())) { String key = word.trim().toLowerCase(Locale.getDefault()); _dict.fillSegment(key.toCharArray()); return key; } else return null; } 这里的问题是word.trim().toLowerCase(Locale.getDefault())。 而进行切分时,并没有对字符串做相关处理,导致bug。
WordDictionary加载字典有如下代码(150行左右), private String addWord(String word) {
if (null != word && !"".equals(word.trim())) { String key = word.trim().toLowerCase(Locale.getDefault()); _dict.fillSegment(key.toCharArray()); return key; } else return null; } 这里的问题是word.trim().toLowerCase(Locale.getDefault())。 而进行切分时,并没有对字符串做相关处理,导致bug。