Skip to content

Commit

Permalink
调整词典
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Dec 11, 2014
1 parent 4311451 commit a3466af
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 566 deletions.
150 changes: 0 additions & 150 deletions main/java/com/hankcs/hanlp/dictionary/AddressDictionary.java

This file was deleted.

2 changes: 1 addition & 1 deletion main/java/com/hankcs/hanlp/dictionary/CoreDictionary.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class CoreDictionary
public final static String path = HanLP.Config.CoreDictionaryPath;
public static final int totalFrequency = 221894;

// public final static String path = "data/dictionary/CoreDictionary.txt";
// public final static String path = "data/dictionary/CoreNatureDictionary.mini.txt";
// 自动加载词典
static
{
Expand Down
15 changes: 15 additions & 0 deletions main/java/com/hankcs/hanlp/dictionary/CoreSynonymDictionary.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ public static long distance(CommonSynonymDictionary.SynonymItem itemA, CommonSyn
return itemA.distance(itemB);
}

/**
* 判断两个单词之间的语义距离
* @param A
* @param B
* @return
*/
public static long distance(String A, String B)
{
CommonSynonymDictionary.SynonymItem itemA = get(A);
CommonSynonymDictionary.SynonymItem itemB = get(B);
if (itemA == null || itemB == null) return Long.MAX_VALUE;

return distance(itemA, itemB);
}

/**
* 将分词结果转换为同义词列表
* @param sentence 句子
Expand Down
167 changes: 0 additions & 167 deletions main/java/com/hankcs/hanlp/recognition/ns/AddressRecognition.java

This file was deleted.

Loading

0 comments on commit a3466af

Please sign in to comment.