public class SNLSH<E> extends Object implements NearestNeighborSearch<SNLSH.AbstractSentence,E>, KNNSearch<SNLSH.AbstractSentence,E>, RNNSearch<SNLSH.AbstractSentence,E>
LSH| Modifier and Type | Class and Description |
|---|---|
static class |
SNLSH.AbstractSentence |
static class |
SNLSH.SimHash |
| Constructor and Description |
|---|
SNLSH(int bandSize) |
| Modifier and Type | Method and Description |
|---|---|
Neighbor<SNLSH.AbstractSentence,E>[] |
knn(SNLSH.AbstractSentence q,
int k)
Search the k nearest neighbors to the query.
|
Neighbor<SNLSH.AbstractSentence,E> |
nearest(SNLSH.AbstractSentence q)
Search the nearest neighbor to the given sample.
|
void |
put(SNLSH.AbstractSentence sentence,
E v) |
void |
range(SNLSH.AbstractSentence q,
double radius,
List<Neighbor<SNLSH.AbstractSentence,E>> neighbors)
Search the neighbors in the given radius of query object, i.e.
|
public void put(SNLSH.AbstractSentence sentence, E v)
public Neighbor<SNLSH.AbstractSentence,E>[] knn(SNLSH.AbstractSentence q, int k)
KNNSearchknn in interface KNNSearch<SNLSH.AbstractSentence,E>q - the query key.k - the number of nearest neighbors to search for.public Neighbor<SNLSH.AbstractSentence,E> nearest(SNLSH.AbstractSentence q)
NearestNeighborSearchnearest in interface NearestNeighborSearch<SNLSH.AbstractSentence,E>q - the query key.public void range(SNLSH.AbstractSentence q, double radius, List<Neighbor<SNLSH.AbstractSentence,E>> neighbors)
RNNSearchrange in interface RNNSearch<SNLSH.AbstractSentence,E>q - the query key.radius - the radius of search range from target.neighbors - the list to store found neighbors in the given range on output.Copyright © 2015. All rights reserved.