Check whether the word is OOV or not for amanatto update.
Bug: 11736529 Change-Id: I27973212da7e922b2185dbb4febfb5bb4dfbdcbb
This commit is contained in:
parent
5742a415f3
commit
05113c1847
4 changed files with 5 additions and 1 deletions
|
@ -365,6 +365,7 @@ public final class BinaryDictionary extends Dictionary {
|
|||
}
|
||||
|
||||
public static class LanguageModelParam {
|
||||
public final String mTargetWord;
|
||||
public final int[] mWord0;
|
||||
public final int[] mWord1;
|
||||
// TODO: this needs to be a list of shortcuts
|
||||
|
@ -379,6 +380,7 @@ public final class BinaryDictionary extends Dictionary {
|
|||
// Constructor for unigram. TODO: support shortcuts
|
||||
public LanguageModelParam(final String word, final int unigramProbability,
|
||||
final int timestamp) {
|
||||
mTargetWord = word;
|
||||
mWord0 = null;
|
||||
mWord1 = StringUtils.toCodePointArray(word);
|
||||
mShortcutTarget = null;
|
||||
|
@ -394,6 +396,7 @@ public final class BinaryDictionary extends Dictionary {
|
|||
public LanguageModelParam(final String word0, final String word1,
|
||||
final int unigramProbability, final int bigramProbability,
|
||||
final int timestamp) {
|
||||
mTargetWord = word1;
|
||||
mWord0 = StringUtils.toCodePointArray(word0);
|
||||
mWord1 = StringUtils.toCodePointArray(word1);
|
||||
mShortcutTarget = null;
|
||||
|
|
|
@ -42,6 +42,7 @@ const int ForgettingCurveUtils::DISCARD_LEVEL_ZERO_ENTRY_TIME_STEP_COUNT_THRESHO
|
|||
|
||||
const ForgettingCurveUtils::ProbabilityTable ForgettingCurveUtils::sProbabilityTable;
|
||||
|
||||
// TODO: Revise the logic to decide the initial probability depending on the given probability.
|
||||
/* static */ const HistoricalInfo ForgettingCurveUtils::createUpdatedHistoricalInfo(
|
||||
const HistoricalInfo *const originalHistoricalInfo,
|
||||
const int newProbability, const int timestamp) {
|
||||
|
|
|
@ -26,7 +26,6 @@ namespace latinime {
|
|||
|
||||
class DictionaryHeaderStructurePolicy;
|
||||
|
||||
// TODO: Quit using bigram probability to indicate the delta.
|
||||
class ForgettingCurveUtils {
|
||||
public:
|
||||
static const int MAX_UNIGRAM_COUNT;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
namespace latinime {
|
||||
|
||||
// TODO: Quit using bigram probability to indicate the delta.
|
||||
class ProbabilityUtils {
|
||||
public:
|
||||
static AK_FORCE_INLINE int backoff(const int unigramProbability) {
|
||||
|
|
Loading…
Reference in a new issue