Add hacks for better handling count value during migration.
Bug: 14425059 Change-Id: Ib050574aa7c4babd4285322a11c3af9be9fbab1e
This commit is contained in:
parent
2383575d2d
commit
c611989929
2 changed files with 4 additions and 1 deletions
|
@ -65,6 +65,8 @@ const BigramEntry BigramDictContent::getBigramEntryAndAdvancePosition(
|
||||||
(encodedTargetTerminalId == Ver4DictConstants::INVALID_BIGRAM_TARGET_TERMINAL_ID) ?
|
(encodedTargetTerminalId == Ver4DictConstants::INVALID_BIGRAM_TARGET_TERMINAL_ID) ?
|
||||||
Ver4DictConstants::NOT_A_TERMINAL_ID : encodedTargetTerminalId;
|
Ver4DictConstants::NOT_A_TERMINAL_ID : encodedTargetTerminalId;
|
||||||
if (mHasHistoricalInfo) {
|
if (mHasHistoricalInfo) {
|
||||||
|
// Hack for better migration.
|
||||||
|
count += level;
|
||||||
const HistoricalInfo historicalInfo(timestamp, level, count);
|
const HistoricalInfo historicalInfo(timestamp, level, count);
|
||||||
return BigramEntry(hasNext, probability, &historicalInfo, targetTerminalId);
|
return BigramEntry(hasNext, probability, &historicalInfo, targetTerminalId);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -50,7 +50,8 @@ const ProbabilityEntry ProbabilityDictContent::getProbabilityEntry(const int ter
|
||||||
Ver4DictConstants::WORD_LEVEL_FIELD_SIZE, &entryPos);
|
Ver4DictConstants::WORD_LEVEL_FIELD_SIZE, &entryPos);
|
||||||
const int count = buffer->readUintAndAdvancePosition(
|
const int count = buffer->readUintAndAdvancePosition(
|
||||||
Ver4DictConstants::WORD_COUNT_FIELD_SIZE, &entryPos);
|
Ver4DictConstants::WORD_COUNT_FIELD_SIZE, &entryPos);
|
||||||
const HistoricalInfo historicalInfo(timestamp, level, count);
|
// Hack for better migration.
|
||||||
|
const HistoricalInfo historicalInfo(timestamp, level, count + level);
|
||||||
return ProbabilityEntry(flags, probability, &historicalInfo);
|
return ProbabilityEntry(flags, probability, &historicalInfo);
|
||||||
} else {
|
} else {
|
||||||
return ProbabilityEntry(flags, probability);
|
return ProbabilityEntry(flags, probability);
|
||||||
|
|
Loading…
Reference in a new issue