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)
ContextEncodedLmCache
getCached
in interface ContextEncodedLmCache
public void putCached(long contextOffset, int contextOrder, int word, float score, int hash, ContextEncodedNgramLanguageModel.LmContextInfo outputPrefix)
putCached
in interface ContextEncodedLmCache
public int capacity()
capacity
in interface ContextEncodedLmCache