am b30f7e4b: Merge "Check whether the word is OOV or not for amanatto update."
* commit 'b30f7e4bceefc4f30c7b942675cc6af5f6d8d852': Check whether the word is OOV or not for amanatto update.main
commit
de63718309
|
@ -365,6 +365,7 @@ public final class BinaryDictionary extends Dictionary {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class LanguageModelParam {
|
public static class LanguageModelParam {
|
||||||
|
public final String mTargetWord;
|
||||||
public final int[] mWord0;
|
public final int[] mWord0;
|
||||||
public final int[] mWord1;
|
public final int[] mWord1;
|
||||||
// TODO: this needs to be a list of shortcuts
|
// 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
|
// 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;
|
||||||
mWord0 = null;
|
mWord0 = null;
|
||||||
mWord1 = StringUtils.toCodePointArray(word);
|
mWord1 = StringUtils.toCodePointArray(word);
|
||||||
mShortcutTarget = null;
|
mShortcutTarget = null;
|
||||||
|
@ -394,6 +396,7 @@ public final class BinaryDictionary extends Dictionary {
|
||||||
public LanguageModelParam(final String word0, final String word1,
|
public LanguageModelParam(final String word0, final String word1,
|
||||||
final int unigramProbability, final int bigramProbability,
|
final int unigramProbability, final int bigramProbability,
|
||||||
final int timestamp) {
|
final int timestamp) {
|
||||||
|
mTargetWord = word1;
|
||||||
mWord0 = StringUtils.toCodePointArray(word0);
|
mWord0 = StringUtils.toCodePointArray(word0);
|
||||||
mWord1 = StringUtils.toCodePointArray(word1);
|
mWord1 = StringUtils.toCodePointArray(word1);
|
||||||
mShortcutTarget = null;
|
mShortcutTarget = null;
|
||||||
|
|
|
@ -42,6 +42,7 @@ const int ForgettingCurveUtils::DISCARD_LEVEL_ZERO_ENTRY_TIME_STEP_COUNT_THRESHO
|
||||||
|
|
||||||
const ForgettingCurveUtils::ProbabilityTable ForgettingCurveUtils::sProbabilityTable;
|
const ForgettingCurveUtils::ProbabilityTable ForgettingCurveUtils::sProbabilityTable;
|
||||||
|
|
||||||
|
// TODO: Revise the logic to decide the initial probability depending on the given probability.
|
||||||
/* static */ const HistoricalInfo ForgettingCurveUtils::createUpdatedHistoricalInfo(
|
/* static */ const HistoricalInfo ForgettingCurveUtils::createUpdatedHistoricalInfo(
|
||||||
const HistoricalInfo *const originalHistoricalInfo,
|
const HistoricalInfo *const originalHistoricalInfo,
|
||||||
const int newProbability, const int timestamp) {
|
const int newProbability, const int timestamp) {
|
||||||
|
|
|
@ -26,7 +26,6 @@ namespace latinime {
|
||||||
|
|
||||||
class DictionaryHeaderStructurePolicy;
|
class DictionaryHeaderStructurePolicy;
|
||||||
|
|
||||||
// TODO: Quit using bigram probability to indicate the delta.
|
|
||||||
class ForgettingCurveUtils {
|
class ForgettingCurveUtils {
|
||||||
public:
|
public:
|
||||||
static const int MAX_UNIGRAM_COUNT;
|
static const int MAX_UNIGRAM_COUNT;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
namespace latinime {
|
namespace latinime {
|
||||||
|
|
||||||
|
// TODO: Quit using bigram probability to indicate the delta.
|
||||||
class ProbabilityUtils {
|
class ProbabilityUtils {
|
||||||
public:
|
public:
|
||||||
static AK_FORCE_INLINE int backoff(const int unigramProbability) {
|
static AK_FORCE_INLINE int backoff(const int unigramProbability) {
|
||||||
|
|
Loading…
Reference in New Issue