|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.tumba.ngram.compression.ExcludingAdaptiveUnigramModel
final class ExcludingAdaptiveUnigramModel
Package class for use by the PPMModel. A fragmentary adaptive unigram model that allows exclusions in converting points to intervals and vice-versa. One such model will be used for each unigram context.
Field Summary | |
---|---|
private int[] |
_count
Counts for each outcome. |
private static int |
EOF_INDEX
Index in the count array for the end-of-file outcome. |
private static int |
MAX_INDIVIDUAL_COUNT
Maximum count before rescaling. |
Constructor Summary | |
---|---|
ExcludingAdaptiveUnigramModel()
Construct an excluding adaptive unigram model. |
Method Summary | |
---|---|
void |
increment(int i)
Increment the count for the given outcome. |
void |
interval(int symbol,
int[] result,
ByteSet exclusions)
Compute the resulting interval to code the specified symbol given the specified excluded bytes. |
int |
pointToSymbol(int midCount,
ByteSet exclusions)
Return the symbol corresponding to the specified count, given the specified excluded bytes. |
private void |
rescale()
Rescale the counts by dividing all frequencies by 2, but taking a minimum of 1. |
int |
totalCount(ByteSet exclusions)
Total count for interval given specified set of exclusions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int[] _count
private static final int MAX_INDIVIDUAL_COUNT
private static final int EOF_INDEX
Constructor Detail |
---|
public ExcludingAdaptiveUnigramModel()
Method Detail |
---|
public void interval(int symbol, int[] result, ByteSet exclusions)
symbol
- Symbol to code.result
- Interval to code the symbol.exclusions
- Bytes to exclude as possible outcomes for interval.public int pointToSymbol(int midCount, ByteSet exclusions)
midCount
- Count of symbol to return.exclusions
- Bytes to exclude from consideration.
public int totalCount(ByteSet exclusions)
exclusions
- Bytes to exclude as outcomes.
public void increment(int i)
i
- Outcome to incrementprivate void rescale()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |