Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs authored and huchengyuan committed Jun 3, 2016
1 parent da7e84e commit 460bcf3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Binary file modified data/dictionary/other/CharType.dat.yes
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class CharType
*/
public static final byte CT_OTHER = CT_SINGLE + 12;

static byte[] type;
public static byte[] type;

static
{
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/hankcs/hanlp/seg/common/WordNet.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public void add(int line, List<AtomNode> atomSegment)
id = CoreDictionary.M_WORD_ID;
break;
case Predefine.CT_DELIMITER:
case Predefine.CT_OTHER:
nature = Nature.w;
break;
case Predefine.CT_SINGLE://12021-2129-3121
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/hankcs/hanlp/utility/TextUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public static int charType(String str)
int ub2 = getUnsigned(b2);
if (ub1 < 128)
{
if (" *\"!,.?()[]{}+=/\\;:|".indexOf((char) b1) != -1)
if (' ' == b1) return CT_OTHER;
if ("*\"!,.?()[]{}+=/\\;:|".indexOf((char) b1) != -1)
return CT_DELIMITER;
if ("0123456789".indexOf((char)b1) != -1)
return CT_NUM;
Expand Down

0 comments on commit 460bcf3

Please sign in to comment.