Merge "Use isFirstCharUppercase instead of get first code point."

main
Keisuke Kuroyanagi 2014-03-10 11:42:22 +00:00 committed by Android (Google) Code Review
commit 89dbd056d1
3 changed files with 2 additions and 4 deletions

View File

@ -218,7 +218,7 @@ class DicNode {
} }
bool isFirstCharUppercase() const { bool isFirstCharUppercase() const {
const int c = getOutputWordBuf()[0]; const int c = mDicNodeState.mDicNodeStateOutput.getCodePointAt(0);
return CharUtils::isAsciiUpper(c); return CharUtils::isAsciiUpper(c);
} }

View File

@ -61,7 +61,6 @@ class DicNodeStateOutput {
} }
} }
// TODO: Remove
int getCodePointAt(const int index) const { int getCodePointAt(const int index) const {
return mCodePointsBuf[index]; return mCodePointsBuf[index];
} }

View File

@ -162,9 +162,8 @@ class TypingTraversal : public Traversal {
if (probability < ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY) { if (probability < ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY) {
return false; return false;
} }
const int c = dicNode->getOutputWordBuf()[0];
const bool shortCappedWord = dicNode->getNodeCodePointCount() const bool shortCappedWord = dicNode->getNodeCodePointCount()
< ScoringParams::THRESHOLD_SHORT_WORD_LENGTH && CharUtils::isAsciiUpper(c); < ScoringParams::THRESHOLD_SHORT_WORD_LENGTH && dicNode->isFirstCharUppercase();
return !shortCappedWord return !shortCappedWord
|| probability >= ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY_FOR_CAPPED; || probability >= ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY_FOR_CAPPED;
} }