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::initGeometricDistanceInfos() 32 static const float NEAR_KEY_NORMALIZED_SQUARED_THRESHOLD; 33 34 // Used by ProximityInfoStateUtils::updateNearKeysDistances() 35 static const float NEAR_KEY_THRESHOLD_FOR_DISTANCE; 36 37 // Used by ProximityInfoStateUtils::isPrevLocalMin() 38 static const float MARGIN_FOR_PREV_LOCAL_MIN; 39 40 // Used by ProximityInfoStateUtils::getPointScore() 41 static const int DISTANCE_BASE_SCALE; 42 static const float NEAR_KEY_THRESHOLD_FOR_POINT_SCORE; 43 static const int CORNER_CHECK_DISTANCE_THRESHOLD_SCALE; 44 static const float NOT_LOCALMIN_DISTANCE_SCORE; 45 static const float LOCALMIN_DISTANCE_AND_NEAR_TO_KEY_SCORE; 46 static const float CORNER_ANGLE_THRESHOLD_FOR_POINT_SCORE; 47 static const float CORNER_SUM_ANGLE_THRESHOLD; 48 static const float CORNER_SCORE; 49 50 // Used by ProximityInfoStateUtils::refreshSpeedRates() 51 static const int NUM_POINTS_FOR_SPEED_CALCULATION; 52 53 // Used by ProximityInfoStateUtils::pushTouchPoint() 54 static const int LAST_POINT_SKIP_DISTANCE_SCALE; 55 56 // Used by ProximityInfoStateUtils::updateAlignPointProbabilities() 57 static const float MIN_PROBABILITY; 58 static const float MAX_SKIP_PROBABILITY; 59 static const float SKIP_FIRST_POINT_PROBABILITY; 60 static const float SKIP_LAST_POINT_PROBABILITY; 61 static const float MIN_SPEED_RATE_FOR_SKIP_PROBABILITY; 62 static const float SPEED_WEIGHT_FOR_SKIP_PROBABILITY; 63 static const float SLOW_STRAIGHT_WEIGHT_FOR_SKIP_PROBABILITY; 64 static const float NEAREST_DISTANCE_WEIGHT; 65 static const float NEAREST_DISTANCE_BIAS; 66 static const float NEAREST_DISTANCE_WEIGHT_FOR_LAST; 67 static const float NEAREST_DISTANCE_BIAS_FOR_LAST; 68 static const float ANGLE_WEIGHT; 69 static const float DEEP_CORNER_ANGLE_THRESHOLD; 70 static const float SKIP_DEEP_CORNER_PROBABILITY; 71 static const float CORNER_ANGLE_THRESHOLD; 72 static const float STRAIGHT_ANGLE_THRESHOLD; 73 static const float SKIP_CORNER_PROBABILITY; 74 static const float SPEED_MARGIN; 75 static const float CENTER_VALUE_OF_NORMALIZED_DISTRIBUTION; 76 static const float SPEEDxANGLE_WEIGHT_FOR_STANDARD_DEVIATION; 77 static const float MAX_SPEEDxANGLE_RATE_FOR_STANDARD_DEVIATION; 78 static const float SPEEDxNEAREST_WEIGHT_FOR_STANDARD_DEVIATION; 79 static const float MAX_SPEEDxNEAREST_RATE_FOR_STANDARD_DEVIATION; 80 static const float MIN_STANDARD_DEVIATION; 81 static const float PREV_DISTANCE_WEIGHT; 82 static const float NEXT_DISTANCE_WEIGHT; 83 84 // Used by ProximityInfoStateUtils::suppressCharProbabilities() 85 static const float SUPPRESSION_LENGTH_WEIGHT; 86 static const float MIN_SUPPRESSION_RATE; 87 static const float SUPPRESSION_WEIGHT; 88 static const float SUPPRESSION_WEIGHT_FOR_PROBABILITY_GAIN; 89 static const float SKIP_PROBABALITY_WEIGHT_FOR_PROBABILITY_GAIN; 90 91 // Used by ProximityInfoStateUtils::getMostProbableString() 92 static const float DEMOTION_LOG_PROBABILITY; 93 94 // Used by ProximityInfoStateUtils::updateSampledSearchKeySets() 95 static const float SEARCH_KEY_RADIUS_RATIO; 96 97 // Used by ProximityInfoStateUtils::calculateBeelineSpeedRate() 98 static const int LOOKUP_RADIUS_PERCENTILE; 99 static const int FIRST_POINT_TIME_OFFSET_MILLIS; 100 static const int STRONG_DOUBLE_LETTER_TIME_MILLIS; 101 102 // Used by ProximityInfoStateUtils::calculateNormalizedSquaredDistance() 103 static const int NORMALIZED_SQUARED_DISTANCE_SCALING_FACTOR; 104 105 private: 106 DISALLOW_IMPLICIT_CONSTRUCTORS(ProximityInfoParams); 107 }; 108 } // namespace latinime 109 #endif // LATINIME_PROXIMITY_INFO_PARAMS_H 110