public class KShingling extends HashSet<String> implements Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
k |
Constructor and Description |
---|
KShingling() |
KShingling(int k) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(String s)
Add a k-shingle s to the list of possible shingles
|
boolean[] |
booleanVectorOf(String s)
Compute and return the boolean vector representation of string s.
|
static int |
countOccurences(String substring,
String str) |
int |
getK() |
Set<Integer> |
integerSetOf(String s)
Compute the boolean representation of string s, returned as a set of
position integers.
|
static void |
main(String[] args) |
boolean |
parse(String s)
Extract all k-singles from sting s and add them to the list of possible
shingles
|
static void |
printArray(boolean[] a) |
static void |
printArray(int[] a) |
int[] |
profileOf(String s)
Compute and return the profile of s, as defined by Ukkonen "Approximate
string-matching with q-grams and maximal matches".
|
void |
setK(int k)
Set the size of k-grams.
|
clear, clone, contains, isEmpty, iterator, remove, size
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray, toString
public static void main(String[] args)
public static void printArray(boolean[] a)
public static void printArray(int[] a)
public int getK()
public final void setK(int k)
k
- public boolean parse(String s)
s
- public boolean add(String s)
public boolean[] booleanVectorOf(String s)
s
- public Set<Integer> integerSetOf(String s)
s
- public int[] profileOf(String s)
s
- Copyright © 2015. All rights reserved.