Use isFirstCharUppercase instead of get first code point.

Change-Id: I0a28305397bfc1e7218e16df00839781a74f5599
main
Keisuke Kuroyanagi 2014-03-10 18:36:14 +09:00
parent 0a5efa31de
commit b43ea5c335
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;
}