aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java4
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java2
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java5
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/NeedsToDisplayLanguage.java44
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java25
-rw-r--r--java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java5
-rw-r--r--java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java24
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java28
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java15
-rw-r--r--java/src/com/android/inputmethod/latin/UserBinaryDictionary.java5
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java33
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java15
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogicHandler.java6
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/FormatSpec.java38
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/MakedictLog.java47
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java2
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/WordProperty.java1
-rw-r--r--java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java5
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java11
-rw-r--r--java/src/com/android/inputmethod/latin/utils/BinaryDictionaryUtils.java27
-rw-r--r--java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java2
-rw-r--r--java/src/com/android/inputmethod/latin/utils/LanguageModelParam.java6
-rw-r--r--java/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtils.java43
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java (renamed from java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java)3
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java (renamed from java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java (renamed from java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java)34
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/DictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/DictDecoder.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/DictEncoder.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java (renamed from java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/PendingAttribute.java (renamed from java/src/com/android/inputmethod/latin/makedict/PendingAttribute.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java (renamed from java/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java)0
-rw-r--r--tests/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java (renamed from java/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java)0
37 files changed, 209 insertions, 221 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
index 7fff46aaf..7e2166769 100644
--- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
@@ -632,7 +632,9 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
}
public void setHardwareAcceleratedDrawingEnabled(final boolean enabled) {
- // TODO:
+ if (!enabled) return;
+ // TODO: Should use LAYER_TYPE_SOFTWARE when hardware acceleration is off?
+ setLayerType(LAYER_TYPE_HARDWARE, null);
}
private static void setupAlphabetKey(final TextView alphabetKey, final String label,
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 2dfde9434..37a4bf8f6 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -205,7 +205,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
final boolean subtypeChanged = (oldKeyboard == null)
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
final boolean needsToDisplayLanguage = mSubtypeSwitcher.needsToDisplayLanguage(
- keyboard.mId.mLocale);
+ keyboard.mId.mSubtype);
keyboardView.startDisplayLanguageOnSpacebar(subtypeChanged, needsToDisplayLanguage,
RichInputMethodManager.getInstance().hasMultipleEnabledIMEsOrSubtypes(true));
}
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 3590c486b..8246c924b 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -930,11 +930,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
return middleText;
}
- final String shortText = SubtypeLocaleUtils.getShortDisplayName(subtype);
- if (fitsTextIntoWidth(width, shortText, paint)) {
- return shortText;
- }
-
return "";
}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/NeedsToDisplayLanguage.java b/java/src/com/android/inputmethod/keyboard/internal/NeedsToDisplayLanguage.java
new file mode 100644
index 000000000..e548de589
--- /dev/null
+++ b/java/src/com/android/inputmethod/keyboard/internal/NeedsToDisplayLanguage.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.keyboard.internal;
+
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+/**
+ * This class determines that the language name on the spacebar should be displayed or not.
+ */
+public final class NeedsToDisplayLanguage {
+ private int mEnabledSubtypeCount;
+ private boolean mIsSystemLanguageSameAsInputLanguage;
+
+ public boolean needsToDisplayLanguage(final InputMethodSubtype subtype) {
+ if (SubtypeLocaleUtils.isNoLanguage(subtype)) {
+ return true;
+ }
+ return mEnabledSubtypeCount >= 2 || !mIsSystemLanguageSameAsInputLanguage;
+ }
+
+ public void updateEnabledSubtypeCount(final int count) {
+ mEnabledSubtypeCount = count;
+ }
+
+ public void updateIsSystemLanguageSameAsInputLanguage(final boolean isSame) {
+ mIsSystemLanguageSameAsInputLanguage = isSame;
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index 0aa34e82e..60ac1ba48 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -28,9 +28,10 @@ import com.android.inputmethod.latin.makedict.FormatSpec;
import com.android.inputmethod.latin.makedict.FormatSpec.DictionaryOptions;
import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
import com.android.inputmethod.latin.makedict.WordProperty;
-import com.android.inputmethod.latin.personalization.PersonalizationHelper;
import com.android.inputmethod.latin.settings.NativeSuggestOptions;
+import com.android.inputmethod.latin.utils.BinaryDictionaryUtils;
import com.android.inputmethod.latin.utils.CollectionUtils;
+import com.android.inputmethod.latin.utils.FileUtils;
import com.android.inputmethod.latin.utils.JniUtils;
import com.android.inputmethod.latin.utils.LanguageModelParam;
import com.android.inputmethod.latin.utils.StringUtils;
@@ -81,6 +82,8 @@ public final class BinaryDictionary extends Dictionary {
public static final int FORMAT_WORD_PROPERTY_LEVEL_INDEX = 2;
public static final int FORMAT_WORD_PROPERTY_COUNT_INDEX = 3;
+ public static final String DICT_FILE_NAME_SUFFIX_FOR_MIGRATION = ".migrate";
+
private long mNativeDict;
private final Locale mLocale;
private final long mDictSize;
@@ -244,7 +247,7 @@ public final class BinaryDictionary extends Dictionary {
// TODO: toLowerCase in the native code
final int[] prevWordCodePointArray = (null == prevWord)
? null : StringUtils.toCodePointArray(prevWord);
- final int composerSize = composer.size();
+ final int composerSize = composer.sizeWithoutTrailingSingleQuotes();
final boolean isGesture = composer.isBatchMode();
if (composerSize <= 1 || !isGesture) {
@@ -458,6 +461,24 @@ public final class BinaryDictionary extends Dictionary {
return needsToRunGCNative(mNativeDict, mindsBlockByGC);
}
+ public boolean migrateTo(final int newFormatVersion) {
+ if (!isValidDictionary()) {
+ return false;
+ }
+ final String tmpDictFilePath = mDictFilePath + DICT_FILE_NAME_SUFFIX_FOR_MIGRATION;
+ // TODO: Implement migrateNative(tmpDictFilePath, newFormatVersion).
+ close();
+ final File dictFile = new File(mDictFilePath);
+ final File tmpDictFile = new File(tmpDictFilePath);
+ FileUtils.deleteRecursively(dictFile);
+ if (!BinaryDictionaryUtils.renameDict(tmpDictFile, dictFile)) {
+ return false;
+ }
+ loadDictionary(dictFile.getAbsolutePath(), 0 /* startOffset */,
+ dictFile.length(), mIsUpdatable);
+ return true;
+ }
+
@UsedForTesting
public int calculateProbability(final int unigramProbability, final int bigramProbability) {
if (!isValidDictionary()) return NOT_A_PROBABILITY;
diff --git a/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java
index c2941e424..4e17f8389 100644
--- a/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java
@@ -262,11 +262,6 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
}
@Override
- protected boolean needsToReloadAfterCreation() {
- return true;
- }
-
- @Override
protected boolean haveContentsChanged() {
final long startTime = SystemClock.uptimeMillis();
final int contactCount = getContactCount();
diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
index 7847738e0..92b535458 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
@@ -137,6 +137,11 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
return formatVersion == FormatSpec.VERSION4;
}
+ private boolean needsToMigrateDictionary(final int formatVersion) {
+ // TODO: Check version.
+ return false;
+ }
+
public boolean isValidDictionaryLocked() {
return mBinaryDictionary.isValidDictionary();
}
@@ -269,6 +274,9 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
}
private void runGCAfterAllPrioritizedTasksIfRequiredLocked(final boolean mindsBlockByGC) {
+ if (mBinaryDictionary == null) {
+ return;
+ }
// needsToRunGC() have to be called with lock.
if (mBinaryDictionary.needsToRunGC(mindsBlockByGC)) {
if (setProcessingLargeTaskIfNot()) {
@@ -357,6 +365,9 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
public void run() {
final boolean locked = setProcessingLargeTaskIfNot();
try {
+ if (mBinaryDictionary == null) {
+ return;
+ }
mBinaryDictionary.addMultipleDictionaryEntries(
languageModelParams.toArray(
new LanguageModelParam[languageModelParams.size()]));
@@ -471,15 +482,13 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
if (oldBinaryDictionary != null) {
oldBinaryDictionary.close();
}
+ if (mBinaryDictionary.isValidDictionary()
+ && needsToMigrateDictionary(mBinaryDictionary.getFormatVersion())) {
+ mBinaryDictionary.migrateTo(DICTIONARY_FORMAT_VERSION);
+ }
}
/**
- * Abstract method for checking if it is required to reload the dictionary before writing
- * a binary dictionary.
- */
- abstract protected boolean needsToReloadAfterCreation();
-
- /**
* Create a new binary dictionary and load initial contents.
*/
private void createNewDictionaryLocked() {
@@ -496,6 +505,9 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
}
private void flushDictionaryLocked() {
+ if (mBinaryDictionary == null) {
+ return;
+ }
if (mBinaryDictionary.needsToRunGC(false /* mindsBlockByGC */)) {
mBinaryDictionary.flushWithGC();
} else {
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index 935dd9667..d4301229c 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -34,6 +34,7 @@ import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.compat.InputMethodSubtypeCompatUtils;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
+import com.android.inputmethod.keyboard.internal.NeedsToDisplayLanguage;
import com.android.inputmethod.latin.utils.LocaleUtils;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
@@ -89,23 +90,6 @@ public final class SubtypeSwitcher {
false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */,
SUBTYPE_ID_OF_DUMMY_EMOJI_SUBTYPE);
- static final class NeedsToDisplayLanguage {
- private int mEnabledSubtypeCount;
- private boolean mIsSystemLanguageSameAsInputLanguage;
-
- public boolean getValue() {
- return mEnabledSubtypeCount >= 2 || !mIsSystemLanguageSameAsInputLanguage;
- }
-
- public void updateEnabledSubtypeCount(final int count) {
- mEnabledSubtypeCount = count;
- }
-
- public void updateIsSystemLanguageSameAsInputLanguage(final boolean isSame) {
- mIsSystemLanguageSameAsInputLanguage = isSame;
- }
- }
-
public static SubtypeSwitcher getInstance() {
return sInstance;
}
@@ -265,14 +249,8 @@ public final class SubtypeSwitcher {
// Subtype Switching functions //
//////////////////////////////////
- public boolean needsToDisplayLanguage(final Locale keyboardLocale) {
- if (keyboardLocale.toString().equals(SubtypeLocaleUtils.NO_LANGUAGE)) {
- return true;
- }
- if (!keyboardLocale.equals(getCurrentSubtypeLocale())) {
- return false;
- }
- return mNeedsToDisplayLanguage.getValue();
+ public boolean needsToDisplayLanguage(final InputMethodSubtype subtype) {
+ return mNeedsToDisplayLanguage.needsToDisplayLanguage(subtype);
}
public boolean isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes() {
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();
diff --git a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
index 8078ab541..8838e27c4 100644
--- a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
@@ -269,9 +269,4 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary {
protected boolean haveContentsChanged() {
return true;
}
-
- @Override
- protected boolean needsToReloadAfterCreation() {
- return true;
- }
}
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index a955f375b..8a321e257 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -104,25 +104,6 @@ public final class WordComposer {
refreshSize();
}
- public WordComposer(final WordComposer source) {
- mCombinerChain = source.mCombinerChain;
- mPrimaryKeyCodes = Arrays.copyOf(source.mPrimaryKeyCodes, source.mPrimaryKeyCodes.length);
- mEvents = new ArrayList<Event>(source.mEvents);
- mTypedWord = new StringBuilder(source.mTypedWord);
- mInputPointers.copy(source.mInputPointers);
- mCapsCount = source.mCapsCount;
- mDigitsCount = source.mDigitsCount;
- mIsFirstCharCapitalized = source.mIsFirstCharCapitalized;
- mCapitalizedMode = source.mCapitalizedMode;
- mTrailingSingleQuotesCount = source.mTrailingSingleQuotesCount;
- mIsResumed = source.mIsResumed;
- mIsBatchMode = source.mIsBatchMode;
- mCursorPositionWithinWord = source.mCursorPositionWithinWord;
- mRejectedBatchModeSuggestion = source.mRejectedBatchModeSuggestion;
- mPreviousWordForSuggestion = source.mPreviousWordForSuggestion;
- refreshSize();
- }
-
/**
* Clear out the keys registered so far.
*/
@@ -151,10 +132,22 @@ public final class WordComposer {
* Number of keystrokes in the composing word.
* @return the number of keystrokes
*/
- public final int size() {
+ // This may be made public if need be, but right now it's not used anywhere
+ /* package for tests */ int size() {
return mCodePointSize;
}
+ public boolean isSingleLetter() {
+ return size() == 1;
+ }
+
+ // When the composition contains trailing quotes, we don't pass them to the suggestion engine.
+ // This is because "'tgis'" should be corrected to "'this'", but we can't afford to consider
+ // single quotes as separators because of their very common use as apostrophes.
+ public int sizeWithoutTrailingSingleQuotes() {
+ return size() - mTrailingSingleQuotesCount;
+ }
+
public final boolean isComposingWord() {
return size() > 0;
}
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 4c7dc6499..ec6bd289a 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -130,7 +130,11 @@ public final class InputLogic {
// so we try using some heuristics to find out about these and fix them.
mConnection.tryFixLyingCursorPosition();
cancelDoubleSpacePeriodCountdown();
- mInputLogicHandler = new InputLogicHandler(mLatinIME, this);
+ if (InputLogicHandler.NULL_HANDLER == mInputLogicHandler) {
+ mInputLogicHandler = new InputLogicHandler(mLatinIME, this);
+ } else {
+ mInputLogicHandler.reset();
+ }
}
/**
@@ -141,8 +145,7 @@ public final class InputLogic {
mConnection.finishComposingText();
}
resetComposingState(true /* alsoResetLastComposedWord */);
- mInputLogicHandler.destroy();
- mInputLogicHandler = InputLogicHandler.NULL_HANDLER;
+ mInputLogicHandler.reset();
}
/**
@@ -513,14 +516,12 @@ public final class InputLogic {
mWordComposer);
}
}
- final int wordComposerSize = mWordComposer.size();
- // Since isComposingWord() is true, the size is at least 1.
if (mWordComposer.isCursorFrontOrMiddleOfComposingWord()) {
// If we are in the middle of a recorrection, we need to commit the recorrection
// first so that we can insert the batch input at the current cursor position.
resetEntireInputState(mConnection.getExpectedSelectionStart(),
mConnection.getExpectedSelectionEnd(), true /* clearSuggestionStrip */);
- } else if (wordComposerSize <= 1) {
+ } else if (mWordComposer.isSingleLetter()) {
// We auto-correct the previous (typed, not gestured) string iff it's one character
// long. The reason for this is, even in the middle of gesture typing, you'll still
// tap one-letter words and you want them auto-corrected (typically, "i" in English
@@ -738,7 +739,7 @@ public final class InputLogic {
if (isComposingWord) {
mWordComposer.add(inputTransaction.mEvent);
// If it's the first letter, make note of auto-caps state
- if (mWordComposer.size() == 1) {
+ if (mWordComposer.isSingleLetter()) {
// We pass 1 to getPreviousWordForSuggestion because we were not composing a word
// yet, so the word we want is the 1st word before the cursor.
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogicHandler.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogicHandler.java
index db96de305..42f0d7c00 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogicHandler.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogicHandler.java
@@ -43,7 +43,7 @@ class InputLogicHandler implements Handler.Callback {
// is initialized, though probably only the monkey can actually do this.
public static final InputLogicHandler NULL_HANDLER = new InputLogicHandler() {
@Override
- public void destroy() {}
+ public void reset() {}
@Override
public boolean handleMessage(final Message msg) { return true; }
@Override
@@ -75,8 +75,8 @@ class InputLogicHandler implements Handler.Callback {
mInputLogic = inputLogic;
}
- public void destroy() {
- mNonUIThreadHandler.getLooper().quit();
+ public void reset() {
+ mNonUIThreadHandler.removeCallbacksAndMessages(null);
}
/**
diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
index 07217e48e..f25503488 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
+++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
@@ -18,9 +18,7 @@ package com.android.inputmethod.latin.makedict;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.Constants;
-import com.android.inputmethod.latin.makedict.DictDecoder.DictionaryBufferFactory;
-import java.io.File;
import java.util.Date;
import java.util.HashMap;
@@ -363,42 +361,6 @@ public final class FormatSpec {
}
}
- /**
- * Returns new dictionary decoder.
- *
- * @param dictFile the dictionary file.
- * @param offset the offset in the file.
- * @param length the length of the file, in bytes.
- * @param bufferType The type of buffer, as one of USE_* in DictDecoder.
- * @return new dictionary decoder if the dictionary file exists, otherwise null.
- */
- public static DictDecoder getDictDecoder(final File dictFile, final long offset,
- final long length, final int bufferType) {
- if (dictFile.isDirectory()) {
- return new Ver4DictDecoder(dictFile, bufferType);
- } else if (dictFile.isFile()) {
- return new Ver2DictDecoder(dictFile, offset, length, bufferType);
- }
- return null;
- }
-
- @UsedForTesting
- public static DictDecoder getDictDecoder(final File dictFile, final long offset,
- final long length, final DictionaryBufferFactory factory) {
- if (dictFile.isDirectory()) {
- return new Ver4DictDecoder(dictFile, factory);
- } else if (dictFile.isFile()) {
- return new Ver2DictDecoder(dictFile, offset, length, factory);
- }
- return null;
- }
-
- @UsedForTesting
- public static DictDecoder getDictDecoder(final File dictFile, final long offset,
- final long length) {
- return getDictDecoder(dictFile, offset, length, DictDecoder.USE_READONLY_BYTEBUFFER);
- }
-
private FormatSpec() {
// This utility class is not publicly instantiable.
}
diff --git a/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java b/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java
deleted file mode 100644
index cf07209d9..000000000
--- a/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.inputmethod.latin.makedict;
-
-import android.util.Log;
-
-/**
- * Wrapper to redirect log events to the right output medium.
- */
-public final class MakedictLog {
- public static final boolean DBG = false;
- private static final String TAG = MakedictLog.class.getSimpleName();
-
- public static void d(String message) {
- if (DBG) {
- Log.d(TAG, message);
- }
- }
-
- public static void i(String message) {
- if (DBG) {
- Log.i(TAG, message);
- }
- }
-
- public static void w(String message) {
- Log.w(TAG, message);
- }
-
- public static void e(String message) {
- Log.e(TAG, message);
- }
-}
diff --git a/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java b/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java
index 9dcd63f0c..5fcbb6357 100644
--- a/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java
+++ b/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.latin.makedict;
+import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.BinaryDictionary;
import com.android.inputmethod.latin.utils.CombinedFormatUtils;
@@ -30,6 +31,7 @@ public final class ProbabilityInfo {
public final int mLevel;
public final int mCount;
+ @UsedForTesting
public static ProbabilityInfo max(final ProbabilityInfo probabilityInfo1,
final ProbabilityInfo probabilityInfo2) {
if (probabilityInfo1 == null) {
diff --git a/java/src/com/android/inputmethod/latin/makedict/WordProperty.java b/java/src/com/android/inputmethod/latin/makedict/WordProperty.java
index d94cec424..853392200 100644
--- a/java/src/com/android/inputmethod/latin/makedict/WordProperty.java
+++ b/java/src/com/android/inputmethod/latin/makedict/WordProperty.java
@@ -42,6 +42,7 @@ public final class WordProperty implements Comparable<WordProperty> {
private int mHashCode = 0;
+ @UsedForTesting
public WordProperty(final String word, final ProbabilityInfo probabilityInfo,
final ArrayList<WeightedString> shortcutTargets,
final ArrayList<WeightedString> bigrams,
diff --git a/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java b/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java
index 074ec4074..6f84e1f10 100644
--- a/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java
+++ b/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java
@@ -91,11 +91,6 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB
return false;
}
- @Override
- protected boolean needsToReloadAfterCreation() {
- return false;
- }
-
public void addMultipleDictionaryEntriesToDictionary(
final ArrayList<LanguageModelParam> languageModelParams,
final ExpandableBinaryDictionary.AddMultipleDictionaryEntriesCallback callback) {
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index a07e8eb6a..6a52481b9 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -268,6 +268,7 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
// if it doesn't. See documentation for binarySearch.
final int insertIndex = positionIndex >= 0 ? positionIndex : -positionIndex - 1;
+ // Weak <- insertIndex == 0, ..., insertIndex == mLength -> Strong
if (insertIndex == 0 && mLength >= mMaxLength) {
// In the future, we may want to keep track of the best suggestion score even if
// we are asked for 0 suggestions. In this case, we can use the following
@@ -285,11 +286,6 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
// }
return true;
}
- if (insertIndex >= mMaxLength) {
- // We found a suggestion, but its score is too weak to be kept considering
- // the suggestion limit.
- return true;
- }
final String wordString = new String(word, wordOffset, wordLength);
if (mLength < mMaxLength) {
@@ -297,12 +293,13 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
++mLength;
System.arraycopy(mScores, insertIndex, mScores, insertIndex + 1, copyLen);
mSuggestions.add(insertIndex, wordString);
+ mScores[insertIndex] = score;
} else {
- System.arraycopy(mScores, 1, mScores, 0, insertIndex);
+ System.arraycopy(mScores, 1, mScores, 0, insertIndex - 1);
mSuggestions.add(insertIndex, wordString);
mSuggestions.remove(0);
+ mScores[insertIndex - 1] = score;
}
- mScores[insertIndex] = score;
return true;
}
diff --git a/java/src/com/android/inputmethod/latin/utils/BinaryDictionaryUtils.java b/java/src/com/android/inputmethod/latin/utils/BinaryDictionaryUtils.java
index 638830046..b4658b531 100644
--- a/java/src/com/android/inputmethod/latin/utils/BinaryDictionaryUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/BinaryDictionaryUtils.java
@@ -26,6 +26,8 @@ import java.io.File;
import java.io.IOException;
import java.util.Locale;
import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
public final class BinaryDictionaryUtils {
private static final String TAG = BinaryDictionaryUtils.class.getSimpleName();
@@ -64,6 +66,31 @@ public final class BinaryDictionaryUtils {
return header;
}
+ public static boolean renameDict(final File dictFile, final File newDictFile) {
+ if (dictFile.isFile()) {
+ return dictFile.renameTo(newDictFile);
+ } else if (dictFile.isDirectory()) {
+ final String dictName = dictFile.getName();
+ final String newDictName = newDictFile.getName();
+ if (newDictFile.exists()) {
+ return false;
+ }
+ for (final File file : dictFile.listFiles()) {
+ if (!file.isFile()) {
+ continue;
+ }
+ final String fileName = file.getName();
+ final String newFileName = fileName.replaceFirst(
+ Pattern.quote(dictName), Matcher.quoteReplacement(newDictName));
+ if (!file.renameTo(new File(dictFile, newFileName))) {
+ return false;
+ }
+ }
+ return dictFile.renameTo(newDictFile);
+ }
+ return false;
+ }
+
public static boolean createEmptyDictFile(final String filePath, final long dictVersion,
final Locale locale, final Map<String, String> attributeMap) {
final String[] keyArray = new String[attributeMap.size()];
diff --git a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
index e531d4b09..315913e2f 100644
--- a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
@@ -23,12 +23,10 @@ import android.content.res.Resources;
import android.text.TextUtils;
import android.util.Log;
-import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.AssetFileAddress;
import com.android.inputmethod.latin.BinaryDictionaryGetter;
import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.makedict.BinaryDictIOUtils;
import com.android.inputmethod.latin.makedict.DictionaryHeader;
import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
import com.android.inputmethod.latin.settings.SpacingAndPunctuations;
diff --git a/java/src/com/android/inputmethod/latin/utils/LanguageModelParam.java b/java/src/com/android/inputmethod/latin/utils/LanguageModelParam.java
index acd16a9e4..5ce977d5e 100644
--- a/java/src/com/android/inputmethod/latin/utils/LanguageModelParam.java
+++ b/java/src/com/android/inputmethod/latin/utils/LanguageModelParam.java
@@ -110,6 +110,9 @@ public final class LanguageModelParam {
final LanguageModelParam languageModelParam =
detectWhetherVaildWordOrNotAndGetLanguageModelParam(
prevWord, tempWord, timestamp, dictionaryFacilitator);
+ if (languageModelParam == null) {
+ continue;
+ }
languageModelParams.add(languageModelParam);
prevWord = languageModelParam.mTargetWord;
}
@@ -120,6 +123,9 @@ public final class LanguageModelParam {
final String prevWord, final String targetWord, final int timestamp,
final DictionaryFacilitatorForSuggest dictionaryFacilitator) {
final Locale locale = dictionaryFacilitator.getLocale();
+ if (locale == null) {
+ return null;
+ }
if (!dictionaryFacilitator.isValidWord(targetWord, true /* ignoreCase */)) {
// OOV word.
return createAndGetLanguageModelParamOfWord(prevWord, targetWord, timestamp,
diff --git a/java/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtils.java b/java/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtils.java
index b3871bfb4..4f556f972 100644
--- a/java/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtils.java
@@ -201,11 +201,11 @@ public final class SubtypeLocaleUtils {
// fr_CH swiss F Français (Suisse)
// de qwertz F Deutsch
// de_CH swiss T Deutsch (Schweiz)
- // zz qwerty F No language (QWERTY) in system locale
+ // zz qwerty F Alphabet (QWERTY) in system locale
// fr qwertz T Français (QWERTZ)
// de qwerty T Deutsch (QWERTY)
// en_US azerty T English (US) (AZERTY) exception
- // zz azerty T No language (AZERTY) in system locale
+ // zz azerty T Alphabet (AZERTY) in system locale
private static String getReplacementString(final InputMethodSubtype subtype,
final Locale displayLocale) {
@@ -294,21 +294,21 @@ public final class SubtypeLocaleUtils {
// InputMethodSubtype's display name for spacebar text in its locale.
// isAdditionalSubtype (T=true, F=false)
- // locale layout | Short Middle Full
- // ------ ------- - ---- --------- ----------------------
- // en_US qwerty F En English English (US) exception
- // en_GB qwerty F En English English (UK) exception
- // es_US spanish F Es Español Español (EE.UU.) exception
- // fr azerty F Fr Français Français
- // fr_CA qwerty F Fr Français Français (Canada)
- // fr_CH swiss F Fr Français Français (Suisse)
- // de qwertz F De Deutsch Deutsch
- // de_CH swiss T De Deutsch Deutsch (Schweiz)
- // zz qwerty F QWERTY QWERTY
- // fr qwertz T Fr Français Français
- // de qwerty T De Deutsch Deutsch
- // en_US azerty T En English English (US)
- // zz azerty T AZERTY AZERTY
+ // locale layout | Middle Full
+ // ------ ------- - --------- ----------------------
+ // en_US qwerty F English English (US) exception
+ // en_GB qwerty F English English (UK) exception
+ // es_US spanish F Español Español (EE.UU.) exception
+ // fr azerty F Français Français
+ // fr_CA qwerty F Français Français (Canada)
+ // fr_CH swiss F Français Français (Suisse)
+ // de qwertz F Deutsch Deutsch
+ // de_CH swiss T Deutsch Deutsch (Schweiz)
+ // zz qwerty F QWERTY QWERTY
+ // fr qwertz T Français Français
+ // de qwerty T Deutsch Deutsch
+ // en_US azerty T English English (US)
+ // zz azerty T AZERTY AZERTY
// Get InputMethodSubtype's full display name in its locale.
public static String getFullDisplayName(final InputMethodSubtype subtype) {
@@ -327,15 +327,6 @@ public final class SubtypeLocaleUtils {
return getSubtypeLocaleDisplayName(locale.getLanguage());
}
- // Get InputMethodSubtype's short display name in its locale.
- public static String getShortDisplayName(final InputMethodSubtype subtype) {
- if (isNoLanguage(subtype)) {
- return "";
- }
- final Locale locale = getSubtypeLocale(subtype);
- return StringUtils.capitalizeFirstCodePoint(locale.getLanguage(), locale);
- }
-
// TODO: Get this information from the framework instead of maintaining here by ourselves.
// Sorted list of known Right-To-Left language codes.
private static final String[] SORTED_RTL_LANGUAGES = {
diff --git a/java/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java
index bc856f113..bc856f113 100644
--- a/java/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
index b534bcb09..6f8b07a34 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
@@ -28,7 +28,6 @@ import java.nio.ByteBuffer;
*
* All the methods in this class are static.
*
- * TODO: Remove calls from classes except Ver3DictDecoder
* TODO: Move this file to makedict/internal.
* TODO: Rename this class to DictDecoderUtils.
*/
@@ -356,7 +355,7 @@ public final class BinaryDictDecoderUtils {
* @return true if it's a binary dictionary, false otherwise
*/
public static boolean isBinaryDictionary(final File file) {
- final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, 0, file.length());
+ final DictDecoder dictDecoder = BinaryDictIOUtils.getDictDecoder(file, 0, file.length());
if (dictDecoder == null) {
return false;
}
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
index 39bd98bad..39bd98bad 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
index a180f1c29..42a50be66 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
@@ -18,7 +18,9 @@ package com.android.inputmethod.latin.makedict;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.Constants;
+import com.android.inputmethod.latin.makedict.DictDecoder.DictionaryBufferFactory;
+import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
@@ -32,6 +34,38 @@ public final class BinaryDictIOUtils {
// This utility class is not publicly instantiable.
}
+ /**
+ * Returns new dictionary decoder.
+ *
+ * @param dictFile the dictionary file.
+ * @param bufferType The type of buffer, as one of USE_* in DictDecoder.
+ * @return new dictionary decoder if the dictionary file exists, otherwise null.
+ */
+ public static DictDecoder getDictDecoder(final File dictFile, final long offset,
+ final long length, final int bufferType) {
+ if (dictFile.isDirectory()) {
+ return new Ver4DictDecoder(dictFile, bufferType);
+ } else if (dictFile.isFile()) {
+ return new Ver2DictDecoder(dictFile, offset, length, bufferType);
+ }
+ return null;
+ }
+
+ public static DictDecoder getDictDecoder(final File dictFile, final long offset,
+ final long length, final DictionaryBufferFactory factory) {
+ if (dictFile.isDirectory()) {
+ return new Ver4DictDecoder(dictFile, factory);
+ } else if (dictFile.isFile()) {
+ return new Ver2DictDecoder(dictFile, offset, length, factory);
+ }
+ return null;
+ }
+
+ public static DictDecoder getDictDecoder(final File dictFile, final long offset,
+ final long length) {
+ return getDictDecoder(dictFile, offset, length, DictDecoder.USE_READONLY_BYTEBUFFER);
+ }
+
private static final class Position {
public static final int NOT_READ_PTNODE_COUNT = -1;
diff --git a/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/DictDecoder.java
index a3b28a702..a3b28a702 100644
--- a/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/DictDecoder.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java
index 678c5ca6b..678c5ca6b 100644
--- a/java/src/com/android/inputmethod/latin/makedict/DictEncoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
index f60b3af4f..f60b3af4f 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/PendingAttribute.java b/tests/src/com/android/inputmethod/latin/makedict/PendingAttribute.java
index 70e24cc98..70e24cc98 100644
--- a/java/src/com/android/inputmethod/latin/makedict/PendingAttribute.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/PendingAttribute.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java b/tests/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java
index 862e8c101..862e8c101 100644
--- a/java/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
index 7091c119e..7091c119e 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java
index a286190cb..a286190cb 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
index f3fad7e99..f3fad7e99 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
index dab9a4315..dab9a4315 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
diff --git a/java/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java b/tests/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java
index 2028298f2..2028298f2 100644
--- a/java/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java
+++ b/tests/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java