public abstract class AbstractNgramMap<T> extends java.lang.Object implements NgramMap<T>, java.io.Serializable
NgramMap.Entry<T>
Modifier and Type | Field and Description |
---|---|
protected static byte |
NUM_BITS_PER_BYTE |
protected int |
NUM_SUFFIX_BITS |
protected int |
NUM_WORD_BITS |
protected ConfigOptions |
opts |
protected long |
SUFFIX_BIT_MASK |
protected ValueContainer<T> |
values |
protected long |
WORD_BIT_MASK |
Modifier | Constructor and Description |
---|---|
protected |
AbstractNgramMap(ValueContainer<T> values,
ConfigOptions opts) |
Modifier and Type | Method and Description |
---|---|
protected long |
combineToKey(int word,
long suffixIndex) |
protected static boolean |
containsOutOfVocab(int[] ngram,
int startPos,
int endPos) |
protected long |
contextOffsetOf(long key) |
protected static boolean |
equals(int[] ngram,
int startPos,
int endPos,
int[] cachedNgram) |
protected static int[] |
getSubArray(int[] ngram,
int startPos,
int endPos) |
ValueContainer<T> |
getValues() |
protected int |
wordOf(long key) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearStorage, contains, get, getMaxNgramOrder, getNgramsForOrder, getNumNgrams, getValueAndOffset, getValueStoringArray, handleNgramsFinished, initWithLengths, put, trim
protected static final byte NUM_BITS_PER_BYTE
protected final int NUM_WORD_BITS
protected final int NUM_SUFFIX_BITS
protected final long WORD_BIT_MASK
protected final long SUFFIX_BIT_MASK
protected final ValueContainer<T> values
protected final ConfigOptions opts
protected AbstractNgramMap(ValueContainer<T> values, ConfigOptions opts)
protected final long contextOffsetOf(long key)
key
- protected final int wordOf(long key)
key
- protected final long combineToKey(int word, long suffixIndex)
word
- suffixIndex
- protected static boolean equals(int[] ngram, int startPos, int endPos, int[] cachedNgram)
protected static int[] getSubArray(int[] ngram, int startPos, int endPos)
protected static boolean containsOutOfVocab(int[] ngram, int startPos, int endPos)
public ValueContainer<T> getValues()