Skip to content

Commit

Permalink
fixed issue #11
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed May 8, 2015
1 parent 8803d8f commit 621178e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/com/hankcs/hanlp/summary/TextRankKeyword.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ public class TextRankKeyword extends KeywordExtractor
final static int max_iter = 200;
final static float min_diff = 0.001f;

public TextRankKeyword()
{
// jdk bug : Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract!
System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
}

/**
* 提取关键词
* @param document 文档内容
Expand Down Expand Up @@ -117,7 +111,7 @@ public List<String> getKeyword(String content)
@Override
public int compare(Map.Entry<String, Float> o1, Map.Entry<String, Float> o2)
{
return (o1.getValue() - o2.getValue() > 0 ? -1 : 1);
return o2.getValue().compareTo(o1.getValue());
}
});
// System.out.println(entryList);
Expand Down

0 comments on commit 621178e

Please # to comment.