Skip to content

Commit

Permalink
fix NPE while invalidate pinyin found
Browse files Browse the repository at this point in the history
  • Loading branch information
medcl committed Aug 26, 2016
1 parent 05620aa commit 494dc60
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Binary file modified lib/nlp-lang-1.7.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private boolean readTerm() {
} else {

String pinyin = pinyinList.get(i);
if (pinyin != null) {
if (pinyin != null&&pinyin.length()>0) {

firstLetters.append(pinyin.charAt(0));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public final boolean incrementToken() throws IOException {
} else {

String pinyin = pinyinList.get(i);
if (pinyin != null) {
if (pinyin != null&&pinyin.length()>0) {

firstLetters.append(pinyin.charAt(0));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,15 @@ private HashMap<String, ArrayList<String>> getStringArrayListHashMap(String[] s,
}
return result;
}

// @Test
// public void TestPinyinFunction() {
// List<String> result = Pinyin.pinyin("貌美如誮");
// for (int i = 0; i < result.size(); i++) {
// String s = result.get(i);
// System.out.println(s);
// }
// }


}

0 comments on commit 494dc60

Please sign in to comment.