aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-09 17:35:47 +0900
committerJean Chalard <jchalard@google.com>2012-07-10 18:57:57 +0900
commit4e42e378fa41cfacf2c393a9428d75f6c6a0d7a8 (patch)
tree25ce0493679859f323ae4a6138b4afc38da1392f /java/src/com/android/inputmethod/latin/ExpandableDictionary.java
parent82009901eaa1fd0da95b25c900f8ff12fda9e679 (diff)
downloadlatinime-4e42e378fa41cfacf2c393a9428d75f6c6a0d7a8.tar.gz
latinime-4e42e378fa41cfacf2c393a9428d75f6c6a0d7a8.tar.xz
latinime-4e42e378fa41cfacf2c393a9428d75f6c6a0d7a8.zip
Move stuff around for readability (A86)
Change-Id: I5f4a18e43f3012acf96978d625325bf7c69c9c80
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/ExpandableDictionary.java42
1 files changed, 21 insertions, 21 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
index 76213c0da..05f3c0d94 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
@@ -263,6 +263,27 @@ public class ExpandableDictionary extends Dictionary {
return suggestions;
}
+ // @VisibleForTesting
+ boolean reloadDictionaryIfRequired() {
+ synchronized (mUpdatingLock) {
+ // If we need to update, start off a background task
+ if (mRequiresReload) startDictionaryLoadingTaskLocked();
+ // Currently updating contacts, don't return any results.
+ return mUpdatingDictionary;
+ }
+ }
+
+ @Override
+ public ArrayList<SuggestedWordInfo> getBigrams(final WordComposer codes,
+ final CharSequence previousWord) {
+ if (!reloadDictionaryIfRequired()) {
+ final ArrayList<SuggestedWordInfo> suggestions = new ArrayList<SuggestedWordInfo>();
+ runBigramReverseLookUp(previousWord, suggestions);
+ return suggestions;
+ }
+ return null;
+ }
+
protected final ArrayList<SuggestedWordInfo> getWordsInner(final WordComposer codes,
final CharSequence prevWordForBigrams, final ProximityInfo proximityInfo) {
final ArrayList<SuggestedWordInfo> suggestions = new ArrayList<SuggestedWordInfo>();
@@ -589,16 +610,6 @@ public class ExpandableDictionary extends Dictionary {
return searchWord(childNode.mChildren, word, depth + 1, childNode);
}
- // @VisibleForTesting
- boolean reloadDictionaryIfRequired() {
- synchronized (mUpdatingLock) {
- // If we need to update, start off a background task
- if (mRequiresReload) startDictionaryLoadingTaskLocked();
- // Currently updating contacts, don't return any results.
- return mUpdatingDictionary;
- }
- }
-
private void runBigramReverseLookUp(final CharSequence previousWord,
final ArrayList<SuggestedWordInfo> suggestions) {
// Search for the lowercase version of the word only, because that's where bigrams
@@ -610,17 +621,6 @@ public class ExpandableDictionary extends Dictionary {
}
}
- @Override
- public ArrayList<SuggestedWordInfo> getBigrams(final WordComposer codes,
- final CharSequence previousWord) {
- if (!reloadDictionaryIfRequired()) {
- final ArrayList<SuggestedWordInfo> suggestions = new ArrayList<SuggestedWordInfo>();
- runBigramReverseLookUp(previousWord, suggestions);
- return suggestions;
- }
- return null;
- }
-
/**
* Used for testing purposes and in the spell checker
* This function will wait for loading from database to be done