public class SimHashService extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
SimHashService.Index |
| Constructor and Description |
|---|
SimHashService() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
analysis(String content)
调用分词器,如果你想用自己的分词器。需要覆盖这个方法
|
SimHashService.Index |
createIndex() |
long |
fingerprint(String content)
获得simhash的指纹
|
long |
hash(String word)
hash 方法生成hashcode , 默认采用murmur64的hash算法,如果需要则覆盖这个方法
|
int |
hmDistance(long a,
long b)
比较 ab 的汉明距离
|
int |
hmDistance(String c1,
String c2)
传入两个文章进行汉明距离比较
|
protected static Forest forest
public int hmDistance(long a,
long b)
a - b - public int hmDistance(String c1, String c2)
c1 - c2 - public long fingerprint(String content)
content - public long hash(String word)
word - public SimHashService.Index createIndex()
Copyright © 2017. All rights reserved.