Skip to content

Commit

Permalink
Ignore empty line when loading dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Kuo committed Mar 16, 2016
1 parent 20efa69 commit f39206b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/huaban/analysis/jieba/WordDictionary.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ public void loadUserDict(Path userDict, Charset charset) {
String line = br.readLine();
String[] tokens = line.split("[\t ]+");

if (tokens.length < 1) {
// Ignore empty line
continue;
}

String word = tokens[0];

double freq = 3.0d;
Expand Down

0 comments on commit f39206b

Please sign in to comment.