am b8a2772b: Consolidate LanguageModelParam constructors
* commit 'b8a2772b0e0367bc98b897f8b464e1dd042511df': Consolidate LanguageModelParam constructorsmain
commit
88b4d1c90e
|
@ -35,16 +35,7 @@ public class LanguageModelParam {
|
||||||
// Constructor for unigram. TODO: support shortcuts
|
// Constructor for unigram. TODO: support shortcuts
|
||||||
public LanguageModelParam(final String word, final int unigramProbability,
|
public LanguageModelParam(final String word, final int unigramProbability,
|
||||||
final int timestamp) {
|
final int timestamp) {
|
||||||
mTargetWord = word;
|
this(null /* word0 */, word, unigramProbability, Dictionary.NOT_A_PROBABILITY, timestamp);
|
||||||
mWord0 = null;
|
|
||||||
mWord1 = StringUtils.toCodePointArray(word);
|
|
||||||
mShortcutTarget = null;
|
|
||||||
mUnigramProbability = unigramProbability;
|
|
||||||
mBigramProbability = Dictionary.NOT_A_PROBABILITY;
|
|
||||||
mShortcutProbability = Dictionary.NOT_A_PROBABILITY;
|
|
||||||
mIsNotAWord = false;
|
|
||||||
mIsBlacklisted = false;
|
|
||||||
mTimestamp = timestamp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor for unigram and bigram.
|
// Constructor for unigram and bigram.
|
||||||
|
@ -52,7 +43,7 @@ public class LanguageModelParam {
|
||||||
final int unigramProbability, final int bigramProbability,
|
final int unigramProbability, final int bigramProbability,
|
||||||
final int timestamp) {
|
final int timestamp) {
|
||||||
mTargetWord = word1;
|
mTargetWord = word1;
|
||||||
mWord0 = StringUtils.toCodePointArray(word0);
|
mWord0 = (word0 == null) ? null : StringUtils.toCodePointArray(word0);
|
||||||
mWord1 = StringUtils.toCodePointArray(word1);
|
mWord1 = StringUtils.toCodePointArray(word1);
|
||||||
mShortcutTarget = null;
|
mShortcutTarget = null;
|
||||||
mUnigramProbability = unigramProbability;
|
mUnigramProbability = unigramProbability;
|
||||||
|
|
Loading…
Reference in New Issue