Merge "Make getWordProperty return reconstructed bigram probability."

main
Keisuke Kuroyanagi 2014-03-11 09:37:49 +00:00 committed by Android (Google) Code Review
commit ed72a768d6
2 changed files with 3 additions and 2 deletions

View File

@ -354,7 +354,8 @@ const WordProperty PatriciaTriePolicy::getWordProperty(const int *const codePoin
&word1Probability);
std::vector<int> word1(bigramWord1CodePoints,
bigramWord1CodePoints + word1CodePointCount);
bigrams.push_back(WordProperty::BigramProperty(&word1, bigramsIt.getProbability(),
const int probability = getProbability(word1Probability, bigramsIt.getProbability());
bigrams.push_back(WordProperty::BigramProperty(&word1, probability,
NOT_A_TIMESTAMP /* timestamp */, 0 /* level */, 0 /* count */));
}
}

View File

@ -388,7 +388,7 @@ const WordProperty Ver4PatriciaTriePolicy::getWordProperty(const int *const code
const int probability = bigramEntry.hasHistoricalInfo() ?
ForgettingCurveUtils::decodeProbability(
bigramEntry.getHistoricalInfo(), mHeaderPolicy) :
bigramEntry.getProbability();
getProbability(word1Probability, bigramEntry.getProbability());
bigrams.push_back(WordProperty::BigramProperty(&word1, probability,
historicalInfo->getTimeStamp(), historicalInfo->getLevel(),
historicalInfo->getCount()));