it.unimi.dsi.sux4j.mph
Class HollowTrie<T>
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<K>
it.unimi.dsi.sux4j.mph.AbstractHashFunction<T>
it.unimi.dsi.sux4j.mph.HollowTrie<T>
- All Implemented Interfaces:
- Function<T,java.lang.Long>, Object2LongFunction<T>, java.io.Serializable
public class HollowTrie<T>
- extends AbstractHashFunction<T>
- implements java.io.Serializable
A hollow trie, that is, a compacted trie recording just the length of the paths associated to the internal nodes.
Instances of this class can be used to compute a monotone minimal perfect hashing of the keys.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HollowTrie
public HollowTrie(java.lang.Iterable<? extends T> iterable,
TransformationStrategy<? super T> transform)
HollowTrie
public HollowTrie(java.util.Iterator<? extends T> iterator,
TransformationStrategy<? super T> transform)
getLong
public long getLong(java.lang.Object object)
- Specified by:
getLong
in interface Object2LongFunction<T>
buildTrie
protected it.unimi.dsi.sux4j.mph.HollowTrie.Node buildTrie(ObjectList<BitVector> elements,
ObjectList<BitVector> ends,
int pos,
Reference2LongMap<BitVector> original)
- Builds a trie recursively.
The trie will contain the suffixes of words in words
starting at pos
.
- Parameters:
elements
- a list of elements.pos
- a starting position.
- Returns:
- a trie containing the suffixes of words in
words
starting at pos
.
size
public int size()
- Specified by:
size
in interface Function<T,java.lang.Long>
- Overrides:
size
in class AbstractHashFunction<T>
numBits
public long numBits()
main
public static void main(java.lang.String[] arg)
throws java.lang.NoSuchMethodException,
java.io.IOException,
JSAPException
- Throws:
java.lang.NoSuchMethodException
java.io.IOException
JSAPException