diff options
author | 2014-03-28 13:25:04 +0900 | |
---|---|---|
committer | 2014-03-28 15:26:27 +0900 | |
commit | 8e829c37dff9fb5eec62390bf0e2c6f12fd6781b (patch) | |
tree | 35712e6dc2c9178cd838a0e30c2552f4477c8d8a /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | 2f781026ccfadc2ad91e5c57ff59ecb27dd192e9 (diff) | |
download | latinime-8e829c37dff9fb5eec62390bf0e2c6f12fd6781b.tar.gz latinime-8e829c37dff9fb5eec62390bf0e2c6f12fd6781b.tar.xz latinime-8e829c37dff9fb5eec62390bf0e2c6f12fd6781b.zip |
[CB14.5] Stop copying WordComposers.
This is an overdue refactoring that I have been wanted to
do forever, and that we can at last do now that suggestions
come only from instances of BinaryDictionary instances.
With this, all unit tests and regression tests are
passing again.
Bug: 13667648
Bug: 13665487
Bug: 8636060
Change-Id: Ie23a19f9b7e692edf2ee0b107ddaff2d7db564b6
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 6985d9a84..db0a8a81c 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -101,19 +101,6 @@ public final class Suggest { : typedWord; LatinImeLogger.onAddSuggestedWord(typedWord, Dictionary.TYPE_USER_TYPED); - final WordComposer wordComposerForLookup; - if (trailingSingleQuotesCount > 0) { - wordComposerForLookup = new WordComposer(wordComposer); - for (int i = trailingSingleQuotesCount - 1; i >= 0; --i) { - // TODO: do not create a fake event for this. Ideally the word composer should know - // how to give out the word without trailing quotes and we can remove this entirely - wordComposerForLookup.deleteLast(Event.createSoftwareKeypressEvent( - Event.NOT_A_CODE_POINT, Constants.CODE_DELETE, - Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE)); - } - } else { - wordComposerForLookup = wordComposer; - } final ArrayList<SuggestedWordInfo> rawSuggestions; if (ProductionFlag.INCLUDE_RAW_SUGGESTIONS) { rawSuggestions = CollectionUtils.newArrayList(); @@ -121,7 +108,7 @@ public final class Suggest { rawSuggestions = null; } final SuggestionResults suggestionResults = mDictionaryFacilitator.getSuggestionResults( - wordComposerForLookup, prevWordForBigram, proximityInfo, blockOffensiveWords, + wordComposer, prevWordForBigram, proximityInfo, blockOffensiveWords, additionalFeaturesOptions, SESSION_TYPING, rawSuggestions); final boolean isFirstCharCapitalized = wordComposer.isFirstCharCapitalized(); |