1 /* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef LATINIME_PROXIMITY_INFO_PARAMS_H 18 #define LATINIME_PROXIMITY_INFO_PARAMS_H 19 20 #include "defines.h" 21 22 namespace latinime { 23 24 class ProximityInfoParams { 25 public: 26 static const float NOT_A_DISTANCE_FLOAT; 27 static const int MIN_DOUBLE_LETTER_BEELINE_SPEED_PERCENTILE; 28 static const float VERTICAL_SWEET_SPOT_SCALE; 29 static const float VERTICAL_SWEET_SPOT_SCALE_G; 30 31 // Used by ProximityInfoStateUtils::updateNearKeysDistances() 32 static const float NEAR_KEY_THRESHOLD_FOR_DISTANCE; 33 34 // Used by ProximityInfoStateUtils::isPrevLocalMin() 35 static const float MARGIN_FOR_PREV_LOCAL_MIN; 36 37 // Used by ProximityInfoStateUtils::getPointScore() 38 static const int DISTANCE_BASE_SCALE; 39 static const float NEAR_KEY_THRESHOLD_FOR_POINT_SCORE; 40 static const int CORNER_CHECK_DISTANCE_THRESHOLD_SCALE; 41 static const float NOT_LOCALMIN_DISTANCE_SCORE; 42 static const float LOCALMIN_DISTANCE_AND_NEAR_TO_KEY_SCORE; 43 static const float CORNER_ANGLE_THRESHOLD_FOR_POINT_SCORE; 44 static const float CORNER_SUM_ANGLE_THRESHOLD; 45 static const float CORNER_SCORE; 46 47 // Used by ProximityInfoStateUtils::refreshSpeedRates() 48 static const int NUM_POINTS_FOR_SPEED_CALCULATION; 49 50 // Used by ProximityInfoStateUtils::pushTouchPoint() 51 static const int LAST_POINT_SKIP_DISTANCE_SCALE; 52 53 // Used by ProximityInfoStateUtils::updateAlignPointProbabilities() 54 static const float MIN_PROBABILITY; 55 static const float MAX_SKIP_PROBABILITY; 56 static const float SKIP_FIRST_POINT_PROBABILITY; 57 static const float SKIP_LAST_POINT_PROBABILITY; 58 static const float MIN_SPEED_RATE_FOR_SKIP_PROBABILITY; 59 static const float SPEED_WEIGHT_FOR_SKIP_PROBABILITY; 60 static const float SLOW_STRAIGHT_WEIGHT_FOR_SKIP_PROBABILITY; 61 static const float NEAREST_DISTANCE_WEIGHT; 62 static const float NEAREST_DISTANCE_BIAS; 63 static const float NEAREST_DISTANCE_WEIGHT_FOR_LAST; 64 static const float NEAREST_DISTANCE_BIAS_FOR_LAST; 65 static const float ANGLE_WEIGHT; 66 static const float DEEP_CORNER_ANGLE_THRESHOLD; 67 static const float SKIP_DEEP_CORNER_PROBABILITY; 68 static const float CORNER_ANGLE_THRESHOLD; 69 static const float STRAIGHT_ANGLE_THRESHOLD; 70 static const float SKIP_CORNER_PROBABILITY; 71 static const float SPEED_MARGIN; 72 static const float CENTER_VALUE_OF_NORMALIZED_DISTRIBUTION; 73 static const float SPEEDxANGLE_WEIGHT_FOR_STANDARD_DEVIATION; 74 static const float MAX_SPEEDxANGLE_RATE_FOR_STANDARD_DEVIATION; 75 static const float SPEEDxNEAREST_WEIGHT_FOR_STANDARD_DEVIATION; 76 static const float MAX_SPEEDxNEAREST_RATE_FOR_STANDARD_DEVIATION; 77 static const float MIN_STANDARD_DEVIATION; 78 // X means gesture's direction. Y means gesture's orthogonal direction. 79 static const float STANDARD_DEVIATION_X_WEIGHT_FOR_FIRST; 80 static const float STANDARD_DEVIATION_Y_WEIGHT_FOR_FIRST; 81 static const float STANDARD_DEVIATION_X_WEIGHT_FOR_LAST; 82 static const float STANDARD_DEVIATION_Y_WEIGHT_FOR_LAST; 83 static const float STANDARD_DEVIATION_X_WEIGHT; 84 static const float STANDARD_DEVIATION_Y_WEIGHT; 85 86 // Used by ProximityInfoStateUtils::suppressCharProbabilities() 87 static const float SUPPRESSION_LENGTH_WEIGHT; 88 static const float MIN_SUPPRESSION_RATE; 89 static const float SUPPRESSION_WEIGHT; 90 static const float SUPPRESSION_WEIGHT_FOR_PROBABILITY_GAIN; 91 static const float SKIP_PROBABALITY_WEIGHT_FOR_PROBABILITY_GAIN; 92 93 // Used by ProximityInfoStateUtils::getMostProbableString() 94 static const float DEMOTION_LOG_PROBABILITY; 95 96 // Used by ProximityInfoStateUtils::updateSampledSearchKeySets() 97 static const float SEARCH_KEY_RADIUS_RATIO; 98 99 // Used by ProximityInfoStateUtils::calculateBeelineSpeedRate() 100 static const int LOOKUP_RADIUS_PERCENTILE; 101 static const int FIRST_POINT_TIME_OFFSET_MILLIS; 102 static const int STRONG_DOUBLE_LETTER_TIME_MILLIS; 103 104 // Used by ProximityInfoStateUtils::calculateNormalizedSquaredDistance() 105 static const int NORMALIZED_SQUARED_DISTANCE_SCALING_FACTOR; 106 107 private: 108 DISALLOW_IMPLICIT_CONSTRUCTORS(ProximityInfoParams); 109 }; 110 } // namespace latinime 111 #endif // LATINIME_PROXIMITY_INFO_PARAMS_H 112