Skip to content

Commit

Permalink
fixed issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed May 8, 2015
1 parent 5ce3471 commit 8803d8f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.hankcs</groupId>
<artifactId>hanlp</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>

<name>HanLP</name>
<url>http://www.hankcs.com/</url>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/hankcs/hanlp/seg/Segment.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ protected void mergeNumberQuantifier(List<Vertex> termList, WordNet wordNetAll,
sbQuantifier.setLength(0);
}
}
sbQuantifier.setLength(0);
line += pre.realWord.length();
}
// System.out.println(wordNetAll);
Expand Down
15 changes: 15 additions & 0 deletions src/test/java/com/hankcs/test/seg/TestSegment.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.io.BufferedReader;
import java.io.StringReader;
import java.util.List;

/**
* @author hankcs
Expand Down Expand Up @@ -182,4 +183,18 @@ public void testNumberAndQuantifier() throws Exception
System.out.println(StandardTokenizer.segment(sentence));
}
}

public void testIssue10() throws Exception
{
StandardTokenizer.SEGMENT.enableNumberQuantifierRecognize(true);
IndexTokenizer.SEGMENT.enableNumberQuantifierRecognize(true);
List termList = StandardTokenizer.segment("此帐号有欠费业务是什么");
System.out.println(termList);
termList = IndexTokenizer.segment("此帐号有欠费业务是什么");
System.out.println(termList);
termList = StandardTokenizer.segment("15307971214话费还有多少");
System.out.println(termList);
termList = IndexTokenizer.segment("15307971214话费还有多少");
System.out.println(termList);
}
}

0 comments on commit 8803d8f

Please # to comment.