PersonalizationDictionary.java revision 18df1925358229e98ad1db3d409577353a8e9a92
1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.inputmethod.latin.personalization;
18
19import android.content.Context;
20
21import com.android.inputmethod.annotations.UsedForTesting;
22import com.android.inputmethod.latin.Dictionary;
23
24import java.io.File;
25import java.util.Locale;
26
27public class PersonalizationDictionary extends DecayingExpandableBinaryDictionaryBase {
28    /* package */ static final String NAME = PersonalizationDictionary.class.getSimpleName();
29
30    // TODO: Make this constructor private
31    /* package */ PersonalizationDictionary(final Context context, final Locale locale) {
32        super(context, getDictName(NAME, locale, null /* dictFile */), locale,
33                Dictionary.TYPE_PERSONALIZATION, null /* dictFile */);
34    }
35
36    @UsedForTesting
37    public static PersonalizationDictionary getDictionary(final Context context,
38            final Locale locale, final File dictFile, final String dictNamePrefix) {
39        return PersonalizationHelper.getPersonalizationDictionary(context, locale);
40    }
41}
42