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;
|
2012-04-23 17:45:48 +00:00
|
|
|
|
|
|
|
public class SynchronouslyLoadedUserBinaryDictionary extends UserBinaryDictionary {
|
|
|
|
|
|
|
|
public SynchronouslyLoadedUserBinaryDictionary(final Context context, final String locale) {
|
|
|
|
this(context, locale, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public SynchronouslyLoadedUserBinaryDictionary(final Context context, final String locale,
|
|
|
|
final boolean alsoUseMoreRestrictiveLocales) {
|
|
|
|
super(context, locale, alsoUseMoreRestrictiveLocales);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2012-07-09 08:58:40 +00:00
|
|
|
protected synchronized ArrayList<SuggestedWordInfo> getWords(final WordComposer codes,
|
2012-06-21 04:31:44 +00:00
|
|
|
final CharSequence prevWordForBigrams, final ProximityInfo proximityInfo) {
|
2012-04-23 17:45:48 +00:00
|
|
|
syncReloadDictionaryIfRequired();
|
2012-06-21 04:31:44 +00:00
|
|
|
return getWordsInner(codes, prevWordForBigrams, proximityInfo);
|
2012-04-23 17:45:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public synchronized boolean isValidWord(CharSequence word) {
|
|
|
|
syncReloadDictionaryIfRequired();
|
|
|
|
return isValidWordInner(word);
|
|
|
|
}
|
|
|
|
}
|