From 85df162eeacb1c9395bdd620e15a9212b75589de Mon Sep 17 00:00:00 2001 From: Shaoliang Nie Date: Tue, 22 Aug 2017 11:08:06 -0400 Subject: [PATCH] Allow a set as input to the hash function Allow the hash function in LSHMinHash to take a set as input. --- src/main/java/info/debatty/java/lsh/LSHMinHash.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/info/debatty/java/lsh/LSHMinHash.java b/src/main/java/info/debatty/java/lsh/LSHMinHash.java index beb5812..902a052 100644 --- a/src/main/java/info/debatty/java/lsh/LSHMinHash.java +++ b/src/main/java/info/debatty/java/lsh/LSHMinHash.java @@ -103,6 +103,15 @@ private int computeSignatureSize(final int s, final int n) { public final int[] hash(final boolean[] vector) { return hashSignature(this.mh.signature(vector)); } + + /** + * Bin this set to corresponding buckets. + * @param set + * @return + */ + public final int[] hash(final Set set) { + return hashSignature(this.mh.signature(set)); + } /** * Get the coefficients used by internal hashing functions.