diff options
author | 2012-04-06 19:12:05 +0900 | |
---|---|---|
committer | 2012-04-06 19:33:01 +0900 | |
commit | 24aee9100e92dc4c06cdb54487a4922420fa8660 (patch) | |
tree | 698b855e9dbfc2f1c7106d263bb7b5e54e1807a6 /java/src/com/android/inputmethod/latin/DictionaryFactory.java | |
parent | aa8df599146e9599b872398c067a2ee27079b659 (diff) | |
download | latinime-24aee9100e92dc4c06cdb54487a4922420fa8660.tar.gz latinime-24aee9100e92dc4c06cdb54487a4922420fa8660.tar.xz latinime-24aee9100e92dc4c06cdb54487a4922420fa8660.zip |
Change the flags to a boolean in constructors.
Change-Id: I9939204f3b16346aaebd4d726315ba9c4faf910a
Diffstat (limited to 'java/src/com/android/inputmethod/latin/DictionaryFactory.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/DictionaryFactory.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFactory.java b/java/src/com/android/inputmethod/latin/DictionaryFactory.java index 79dc3f2d3..fedb45407 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryFactory.java +++ b/java/src/com/android/inputmethod/latin/DictionaryFactory.java @@ -43,11 +43,11 @@ public class DictionaryFactory { * @param context application context for reading resources * @param locale the locale for which to create the dictionary * @param fallbackResId the id of the resource to use as a fallback if no pack is found - * @param flagArray an array of flags to use + * @param useFullEditDistance whether to use the full edit distance in suggestions * @return an initialized instance of DictionaryCollection */ public static DictionaryCollection createDictionaryFromManager(final Context context, - final Locale locale, final int fallbackResId, final Flag[] flagArray) { + final Locale locale, final int fallbackResId, final boolean useFullEditDistance) { if (null == locale) { Log.e(TAG, "No locale defined for dictionary"); return new DictionaryCollection(createBinaryDictionary(context, fallbackResId, locale)); @@ -59,8 +59,8 @@ public class DictionaryFactory { if (null != assetFileList) { for (final AssetFileAddress f : assetFileList) { final BinaryDictionary binaryDictionary = - new BinaryDictionary(context, f.mFilename, f.mOffset, f.mLength, flagArray, - locale); + new BinaryDictionary(context, f.mFilename, f.mOffset, f.mLength, + useFullEditDistance, locale); if (binaryDictionary.isValidDictionary()) { dictList.add(binaryDictionary); } @@ -86,7 +86,8 @@ public class DictionaryFactory { */ public static DictionaryCollection createDictionaryFromManager(final Context context, final Locale locale, final int fallbackResId) { - return createDictionaryFromManager(context, locale, fallbackResId, null); + return createDictionaryFromManager(context, locale, fallbackResId, + false /* useFullEditDistance */); } /** @@ -119,8 +120,8 @@ public class DictionaryFactory { Log.e(TAG, "sourceDir is not a file: " + sourceDir); return null; } - return new BinaryDictionary(context, - sourceDir, afd.getStartOffset(), afd.getLength(), null, locale); + return new BinaryDictionary(context, sourceDir, afd.getStartOffset(), afd.getLength(), + false /* useFullEditDistance */, locale); } catch (android.content.res.Resources.NotFoundException e) { Log.e(TAG, "Could not find the resource. resId=" + resId); return null; @@ -141,14 +142,14 @@ public class DictionaryFactory { * @param dictionary the file to read * @param startOffset the offset in the file where the data starts * @param length the length of the data - * @param flagArray the flags to use with this data for testing + * @param useFullEditDistance whether to use the full edit distance in suggestions * @return the created dictionary, or null. */ public static Dictionary createDictionaryForTest(Context context, File dictionary, - long startOffset, long length, Flag[] flagArray, Locale locale) { + long startOffset, long length, final boolean useFullEditDistance, Locale locale) { if (dictionary.isFile()) { return new BinaryDictionary(context, dictionary.getAbsolutePath(), startOffset, length, - flagArray, locale); + useFullEditDistance, locale); } else { Log.e(TAG, "Could not find the file. path=" + dictionary.getAbsolutePath()); return null; |