public final class ArrayEncodedDirectMappedLmCache extends java.lang.Object implements ArrayEncodedLmCache
Constructor and Description |
---|
ArrayEncodedDirectMappedLmCache(int cacheBits,
int maxNgramOrder,
boolean threadSafe) |
Modifier and Type | Method and Description |
---|---|
int |
capacity()
How n-grams can be cached (at most).
|
void |
clear() |
float |
getCached(int[] ngram,
int startPos,
int endPos,
int hash)
Should return Float.NaN if the requested n-gram is not in the cache
|
void |
putCached(int[] ngram,
int startPos,
int endPos,
float f,
int hash) |
public ArrayEncodedDirectMappedLmCache(int cacheBits, int maxNgramOrder, boolean threadSafe)
public float getCached(int[] ngram, int startPos, int endPos, int hash)
ArrayEncodedLmCache
getCached
in interface ArrayEncodedLmCache
public void clear()
clear
in interface ArrayEncodedLmCache
public void putCached(int[] ngram, int startPos, int endPos, float f, int hash)
putCached
in interface ArrayEncodedLmCache
public int capacity()
ArrayEncodedLmCache
capacity
in interface ArrayEncodedLmCache