Package edu.berkeley.nlp.lm.cache
Interface ArrayEncodedLmCache
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ArrayEncodedDirectMappedLmCache
-
Method Summary
Modifier and TypeMethodDescriptionint
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 cachevoid
putCached
(int[] ngram, int startPos, int endPos, float f, int hash)
-
Method Details
-
getCached
float getCached(int[] ngram, int startPos, int endPos, int hash) Should return Float.NaN if the requested n-gram is not in the cache- Parameters:
ngram
-startPos
-endPos
-shortHash
-- Returns:
-
clear
void clear() -
putCached
void putCached(int[] ngram, int startPos, int endPos, float f, int hash) -
capacity
int capacity()How n-grams can be cached (at most).- Returns:
-