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)
ArrayEncodedLmCachegetCached in interface ArrayEncodedLmCachepublic void clear()
clear in interface ArrayEncodedLmCachepublic void putCached(int[] ngram,
int startPos,
int endPos,
float f,
int hash)
putCached in interface ArrayEncodedLmCachepublic int capacity()
ArrayEncodedLmCachecapacity in interface ArrayEncodedLmCache