huaban / jieba-analysis

结巴分词(java版)
https://github.com/huaban/jieba-analysis
Apache License 2.0
2.55k stars 835 forks source link

比较的方法应该要考虑相等的情况 #100

Open love-moon opened 5 years ago

love-moon commented 5 years ago
@Override
public int compareTo(Keyword o)
{
    return this.tfidfvalue-o.tfidfvalue>0?-1:1;
}

这里报错过, Comparison method 什么的,我改成相等返回0,其它不变就正常了

love-moon commented 5 years ago

位于src/main/java/com/qianxinyao/analysis/jieba/keyword/Keyword.java

MeetFuture commented 4 years ago

return Double.compare(this.tfidfvalue, o.tfidfvalue);