public final class UnrankedUncompressedProbBackoffValueContainer extends java.lang.Object implements ProbBackoffValueContainer
| Constructor and Description |
|---|
UnrankedUncompressedProbBackoffValueContainer(boolean storePrefixes,
long[] numNgramsForEachOrder) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int[] ngram,
int startPos,
int endPos,
int ngramOrder,
long offset,
long contextOffset,
int word,
ProbBackoffPair val_,
long suffixOffset,
boolean ngramIsNew)
Adds a new value at the specified offset.
|
void |
clearStorageForOrder(int ngramOrder) |
UnrankedUncompressedProbBackoffValueContainer |
createFreshValues(long[] numNgramsForEachOrder_)
Creates a fresh value container for copying purposes.
|
float |
getBackoff(int ngramOrder,
long index) |
void |
getFromOffset(long index,
int ngramOrder,
ProbBackoffPair outputVal)
Gets the value living at a particular offset.
|
float |
getProb(int ngramOrder,
long index) |
ProbBackoffPair |
getScratchValue()
Creates a fresh value of object (useful for passing as an output
parameter)
|
long |
getSuffixOffset(long index,
int ngramOrder) |
int |
numValueBits(int ngramOrder) |
void |
setFromOtherValues(ValueContainer<ProbBackoffPair> other)
Destructively sets internal storage from another object.
|
void |
setMap(NgramMap<ProbBackoffPair> map)
Initializes a value container with the map that contains it
|
void |
setSizeAtLeast(long size,
int ngramOrder)
Sets internal storage for size for a particular n-gram order
|
boolean |
storeSuffixoffsets() |
void |
trim()
Final clean up of storage.
|
void |
trimAfterNgram(int ngramOrder,
long size)
Clear storage after an n-gram order is complete
|
public UnrankedUncompressedProbBackoffValueContainer(boolean storePrefixes,
long[] numNgramsForEachOrder)
public UnrankedUncompressedProbBackoffValueContainer createFreshValues(long[] numNgramsForEachOrder_)
ValueContainercreateFreshValues in interface ValueContainer<ProbBackoffPair>public final float getProb(int ngramOrder,
long index)
getProb in interface ProbBackoffValueContainerpublic void getFromOffset(long index,
int ngramOrder,
ProbBackoffPair outputVal)
ValueContainergetFromOffset in interface ValueContainer<ProbBackoffPair>public final float getBackoff(int ngramOrder,
long index)
getBackoff in interface ProbBackoffValueContainerpublic ProbBackoffPair getScratchValue()
ValueContainergetScratchValue in interface ProbBackoffValueContainergetScratchValue in interface ValueContainer<ProbBackoffPair>public void setFromOtherValues(ValueContainer<ProbBackoffPair> other)
ValueContainersetFromOtherValues in interface ValueContainer<ProbBackoffPair>public void trim()
ValueContainertrim in interface ValueContainer<ProbBackoffPair>public boolean storeSuffixoffsets()
storeSuffixoffsets in interface ValueContainer<ProbBackoffPair>public int numValueBits(int ngramOrder)
numValueBits in interface ValueContainer<ProbBackoffPair>public boolean add(int[] ngram,
int startPos,
int endPos,
int ngramOrder,
long offset,
long contextOffset,
int word,
ProbBackoffPair val_,
long suffixOffset,
boolean ngramIsNew)
ValueContaineradd in interface ValueContainer<ProbBackoffPair>ngramOrder - As always, ngramOrder is 0-based (0=unigram)public void setSizeAtLeast(long size,
int ngramOrder)
ValueContainersetSizeAtLeast in interface ValueContainer<ProbBackoffPair>public long getSuffixOffset(long index,
int ngramOrder)
getSuffixOffset in interface ProbBackoffValueContainerpublic void trimAfterNgram(int ngramOrder,
long size)
ValueContainertrimAfterNgram in interface ValueContainer<ProbBackoffPair>public void setMap(NgramMap<ProbBackoffPair> map)
ValueContainersetMap in interface ValueContainer<ProbBackoffPair>public void clearStorageForOrder(int ngramOrder)
clearStorageForOrder in interface ValueContainer<ProbBackoffPair>