1 /* 2 * Copyright (C) 2014, 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 #include "dictionary/structure/v4/content/dynamic_language_model_probability_utils.h" 18 19 namespace latinime { 20 21 // Used to provide stable probabilities even if the user's input count is small. 22 const int DynamicLanguageModelProbabilityUtils::ASSUMED_MIN_COUNTS[] = {8192, 2, 2, 1}; 23 24 // Encoded backoff weights. 25 // Note that we give positive values for trigrams and quadgrams that means the weight is more than 26 // 1. 27 // TODO: Apply backoff for main dictionaries and quit giving a positive backoff weight. 28 const int DynamicLanguageModelProbabilityUtils::ENCODED_BACKOFF_WEIGHTS[] = {-32, -4, 2, 8}; 29 30 // This value is used to remove too old entries from the dictionary. 31 const int DynamicLanguageModelProbabilityUtils::DURATION_TO_DISCARD_ENTRY_IN_SECONDS = 32 300 * 24 * 60 * 60; // 300 days 33 34 } // namespace latinime 35