2012-04-23 17:45:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 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;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
|
|
|
import com.android.inputmethod.keyboard.ProximityInfo;
|
2012-06-12 21:57:40 +00:00
|
|
|
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2013-12-13 08:09:16 +00:00
|
|
|
import java.util.Locale;
|
2012-04-23 17:45:48 +00:00
|
|
|
|
2012-09-27 09:16:16 +00:00
|
|
|
public final class SynchronouslyLoadedUserBinaryDictionary extends UserBinaryDictionary {
|
2012-04-23 17:45:48 +00:00
|
|
|
|
2013-12-13 08:09:16 +00:00
|
|
|
public SynchronouslyLoadedUserBinaryDictionary(final Context context, final Locale locale) {
|
2012-04-23 17:45:48 +00:00
|
|
|
this(context, locale, false);
|
|
|
|
}
|
|
|
|
|
2013-12-13 08:09:16 +00:00
|
|
|
public SynchronouslyLoadedUserBinaryDictionary(final Context context, final Locale locale,
|
2012-04-23 17:45:48 +00:00
|
|
|
final boolean alsoUseMoreRestrictiveLocales) {
|
|
|
|
super(context, locale, alsoUseMoreRestrictiveLocales);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2012-07-09 11:13:22 +00:00
|
|
|
public synchronized ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer codes,
|
2013-05-01 11:36:36 +00:00
|
|
|
final String prevWordForBigrams, final ProximityInfo proximityInfo,
|
2013-08-28 10:24:28 +00:00
|
|
|
final boolean blockOffensiveWords, final int[] additionalFeaturesOptions) {
|
2013-09-09 04:04:28 +00:00
|
|
|
reloadDictionaryIfRequired();
|
2013-08-28 10:24:28 +00:00
|
|
|
return super.getSuggestions(codes, prevWordForBigrams, proximityInfo, blockOffensiveWords,
|
|
|
|
additionalFeaturesOptions);
|
2012-04-23 17:45:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2012-10-03 06:19:43 +00:00
|
|
|
public synchronized boolean isValidWord(final String word) {
|
2013-09-09 04:04:28 +00:00
|
|
|
reloadDictionaryIfRequired();
|
2012-04-23 17:45:48 +00:00
|
|
|
return isValidWordInner(word);
|
|
|
|
}
|
|
|
|
}
|