am 89dbd056: Merge "Use isFirstCharUppercase instead of get first code point."

* commit '89dbd056d13e5ecca2a70439b3d9e9d73e4693ea':
  Use isFirstCharUppercase instead of get first code point.
main
Keisuke Kuroyanagi 2014-03-10 04:45:21 -07:00 committed by Android Git Automerger
commit c4ba6e4750
3 changed files with 2 additions and 4 deletions

View File

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

View File

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

View File

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