diff options
author | 2012-05-16 01:49:08 -0700 | |
---|---|---|
committer | 2012-05-16 01:49:08 -0700 | |
commit | 93661b3b353e40dd851c439b7c6dae8b058e8d52 (patch) | |
tree | 4597b13ea988900e0457855b815aa9a4f89c71e4 /java/src | |
parent | 12fbdfb6f906c6d4b02c5a946e4b418fcbfad035 (diff) | |
parent | ed49e4d82e3050bcf0e96babb40ce908d03f87f2 (diff) | |
download | latinime-93661b3b353e40dd851c439b7c6dae8b058e8d52.tar.gz latinime-93661b3b353e40dd851c439b7c6dae8b058e8d52.tar.xz latinime-93661b3b353e40dd851c439b7c6dae8b058e8d52.zip |
am ed49e4d8: Merge "Stop meaningless bigram computations" into jb-dev
* commit 'ed49e4d82e3050bcf0e96babb40ce908d03f87f2':
Stop meaningless bigram computations
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index c4877316e..7832cb522 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -43,20 +43,6 @@ public class Suggest implements Dictionary.WordCallback { public static final int CORRECTION_FULL = 1; public static final int CORRECTION_FULL_BIGRAM = 2; - /** - * Words that appear in both bigram and unigram data gets multiplier ranging from - * BIGRAM_MULTIPLIER_MIN to BIGRAM_MULTIPLIER_MAX depending on the score from - * bigram data. - */ - public static final double BIGRAM_MULTIPLIER_MIN = 1.2; - public static final double BIGRAM_MULTIPLIER_MAX = 1.5; - - /** - * Maximum possible bigram frequency. Will depend on how many bits are being used in data - * structure. Maximum bigram frequency will get the BIGRAM_MULTIPLIER_MAX as the multiplier. - */ - public static final int MAXIMUM_BIGRAM_FREQUENCY = 127; - // It seems the following values are only used for logging. public static final int DIC_USER_TYPED = 0; public static final int DIC_MAIN = 1; @@ -478,25 +464,6 @@ public class Suggest implements Dictionary.WordCallback { } } } else { - if (dataType == Dictionary.UNIGRAM) { - // Check if the word was already added before (by bigram data) - int bigramSuggestion = searchBigramSuggestion(word,offset,length); - if(bigramSuggestion >= 0) { - dataTypeForLog = Dictionary.BIGRAM; - // turn freq from bigram into multiplier specified above - double multiplier = (((double) mBigramSuggestions.get(bigramSuggestion).mScore) - / MAXIMUM_BIGRAM_FREQUENCY) - * (BIGRAM_MULTIPLIER_MAX - BIGRAM_MULTIPLIER_MIN) - + BIGRAM_MULTIPLIER_MIN; - /* Log.d(TAG,"bigram num: " + bigramSuggestion - + " wordB: " + mBigramSuggestions.get(bigramSuggestion).toString() - + " currentScore: " + score + " bigramScore: " - + mBigramScores[bigramSuggestion] - + " multiplier: " + multiplier); */ - score = (int)Math.round((score * multiplier)); - } - } - // Check the last one's score and bail if (suggestions.size() >= prefMaxSuggestions && suggestions.get(prefMaxSuggestions - 1).mScore >= score) return true; |