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_)
ValueContainer
createFreshValues
in interface ValueContainer<ProbBackoffPair>
public final float getProb(int ngramOrder, long index)
getProb
in interface ProbBackoffValueContainer
public void getFromOffset(long index, int ngramOrder, ProbBackoffPair outputVal)
ValueContainer
getFromOffset
in interface ValueContainer<ProbBackoffPair>
public final float getBackoff(int ngramOrder, long index)
getBackoff
in interface ProbBackoffValueContainer
public ProbBackoffPair getScratchValue()
ValueContainer
getScratchValue
in interface ProbBackoffValueContainer
getScratchValue
in interface ValueContainer<ProbBackoffPair>
public void setFromOtherValues(ValueContainer<ProbBackoffPair> other)
ValueContainer
setFromOtherValues
in interface ValueContainer<ProbBackoffPair>
public void trim()
ValueContainer
trim
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)
ValueContainer
add
in interface ValueContainer<ProbBackoffPair>
ngramOrder
- As always, ngramOrder is 0-based (0=unigram)public void setSizeAtLeast(long size, int ngramOrder)
ValueContainer
setSizeAtLeast
in interface ValueContainer<ProbBackoffPair>
public long getSuffixOffset(long index, int ngramOrder)
getSuffixOffset
in interface ProbBackoffValueContainer
public void trimAfterNgram(int ngramOrder, long size)
ValueContainer
trimAfterNgram
in interface ValueContainer<ProbBackoffPair>
public void setMap(NgramMap<ProbBackoffPair> map)
ValueContainer
setMap
in interface ValueContainer<ProbBackoffPair>
public void clearStorageForOrder(int ngramOrder)
clearStorageForOrder
in interface ValueContainer<ProbBackoffPair>