public final class ContextEncodedDirectMappedLmCache extends java.lang.Object implements ContextEncodedLmCache
| Constructor and Description |
|---|
ContextEncodedDirectMappedLmCache(int cacheBits,
boolean threadSafe) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
float |
getCached(long contextOffset,
int contextOrder,
int word,
int hash,
ContextEncodedNgramLanguageModel.LmContextInfo outputPrefix)
Should return Float.NaN if requested n-gram is not in the cache.
|
void |
putCached(long contextOffset,
int contextOrder,
int word,
float score,
int hash,
ContextEncodedNgramLanguageModel.LmContextInfo outputPrefix) |
public ContextEncodedDirectMappedLmCache(int cacheBits,
boolean threadSafe)
public float getCached(long contextOffset,
int contextOrder,
int word,
int hash,
ContextEncodedNgramLanguageModel.LmContextInfo outputPrefix)
ContextEncodedLmCachegetCached in interface ContextEncodedLmCachepublic void putCached(long contextOffset,
int contextOrder,
int word,
float score,
int hash,
ContextEncodedNgramLanguageModel.LmContextInfo outputPrefix)
putCached in interface ContextEncodedLmCachepublic int capacity()
capacity in interface ContextEncodedLmCache