am 97a3ce02: Merge "Refactor"

* commit '97a3ce022c4f158712fb803f7acd0151719b336e':
  Refactor
main
Satoshi Kataoka 2013-03-29 03:59:59 -07:00 committed by Android Git Automerger
commit 70747ad6c3
4 changed files with 21 additions and 19 deletions

View File

@ -33,11 +33,13 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
const int *const xCoordinates, const int *const yCoordinates, const int *const times,
const int *const pointerIds, const bool isGeometric) {
ASSERT(isGeometric || (inputSize < MAX_WORD_LENGTH));
mIsContinuationPossible = ProximityInfoStateUtils::checkAndReturnIsContinuationPossible(
inputSize, xCoordinates, yCoordinates, times, mSampledInputSize, &mSampledInputXs,
&mSampledInputYs, &mSampledTimes, &mSampledInputIndice);
mIsContinuousSuggestionPossible =
ProximityInfoStateUtils::checkAndReturnIsContinuousSuggestionPossible(
inputSize, xCoordinates, yCoordinates, times, mSampledInputSize,
&mSampledInputXs, &mSampledInputYs, &mSampledTimes, &mSampledInputIndice);
if (DEBUG_DICT) {
AKLOGI("isContinuationPossible = %s", (mIsContinuationPossible ? "true" : "false"));
AKLOGI("isContinuousSuggestionPossible = %s",
(mIsContinuousSuggestionPossible ? "true" : "false"));
}
mProximityInfo = proximityInfo;
@ -64,7 +66,7 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
mSampledInputSize = 0;
mMostProbableStringProbability = 0.0f;
if (mIsContinuationPossible && mSampledInputIndice.size() > 1) {
if (mIsContinuousSuggestionPossible && mSampledInputIndice.size() > 1) {
// Just update difference.
// Previous two points are never skipped. Thus, we pop 2 input point data here.
pushTouchPointStartIndex = ProximityInfoStateUtils::trimLastTwoTouchPoints(

View File

@ -47,12 +47,12 @@ class ProximityInfoState {
: mProximityInfo(0), mMaxPointToKeyLength(0.0f), mAverageSpeed(0.0f),
mHasTouchPositionCorrectionData(false), mMostCommonKeyWidthSquare(0),
mKeyCount(0), mCellHeight(0), mCellWidth(0), mGridHeight(0), mGridWidth(0),
mIsContinuationPossible(false), mSampledInputXs(), mSampledInputYs(), mSampledTimes(),
mSampledInputIndice(), mSampledLengthCache(), mBeelineSpeedPercentiles(),
mSampledDistanceCache_G(), mSpeedRates(), mDirections(), mCharProbabilities(),
mSampledNearKeySets(), mSampledSearchKeySets(), mSampledSearchKeyVectors(),
mTouchPositionCorrectionEnabled(false), mSampledInputSize(0),
mMostProbableStringProbability(0.0f) {
mIsContinuousSuggestionPossible(false), mSampledInputXs(), mSampledInputYs(),
mSampledTimes(), mSampledInputIndice(), mSampledLengthCache(),
mBeelineSpeedPercentiles(), mSampledDistanceCache_G(), mSpeedRates(), mDirections(),
mCharProbabilities(), mSampledNearKeySets(), mSampledSearchKeySets(),
mSampledSearchKeyVectors(), mTouchPositionCorrectionEnabled(false),
mSampledInputSize(0), mMostProbableStringProbability(0.0f) {
memset(mInputProximities, 0, sizeof(mInputProximities));
memset(mNormalizedSquaredDistances, 0, sizeof(mNormalizedSquaredDistances));
memset(mPrimaryInputWord, 0, sizeof(mPrimaryInputWord));
@ -143,8 +143,8 @@ class ProximityInfoState {
return mSampledLengthCache[index];
}
bool isContinuationPossible() const {
return mIsContinuationPossible;
bool isContinuousSuggestionPossible() const {
return mIsContinuousSuggestionPossible;
}
float getPointToKeyByIdLength(const int inputIndex, const int keyId) const;
@ -223,7 +223,7 @@ class ProximityInfoState {
int mCellWidth;
int mGridHeight;
int mGridWidth;
bool mIsContinuationPossible;
bool mIsContinuousSuggestionPossible;
std::vector<int> mSampledInputXs;
std::vector<int> mSampledInputYs;

View File

@ -968,10 +968,10 @@ namespace latinime {
return true;
}
/* static */ bool ProximityInfoStateUtils::checkAndReturnIsContinuationPossible(const int inputSize,
const int *const xCoordinates, const int *const yCoordinates, const int *const times,
const int sampledInputSize, const std::vector<int> *const sampledInputXs,
const std::vector<int> *const sampledInputYs,
/* static */ bool ProximityInfoStateUtils::checkAndReturnIsContinuousSuggestionPossible(
const int inputSize, const int *const xCoordinates, const int *const yCoordinates,
const int *const times, const int sampledInputSize,
const std::vector<int> *const sampledInputXs, const std::vector<int> *const sampledInputYs,
const std::vector<int> *const sampledTimes,
const std::vector<int> *const sampledInputIndices) {
if (inputSize < sampledInputSize) {

View File

@ -101,7 +101,7 @@ class ProximityInfoStateUtils {
const std::vector<int> *const sampledTimes,
const std::vector<float> *const sampledSpeedRates,
const std::vector<int> *const sampledBeelineSpeedPercentiles);
static bool checkAndReturnIsContinuationPossible(const int inputSize,
static bool checkAndReturnIsContinuousSuggestionPossible(const int inputSize,
const int *const xCoordinates, const int *const yCoordinates, const int *const times,
const int sampledInputSize, const std::vector<int> *const sampledInputXs,
const std::vector<int> *const sampledInputYs,