aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/utils
diff options
context:
space:
mode:
authorXiaojun Bi <bxj@google.com>2014-04-25 17:15:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-25 17:15:53 +0000
commit516c884b115f2cce1fca9a1599782ccfc433ca1f (patch)
tree23bf01de8a61baac15f2b886864bc992c9befccf /java/src/com/android/inputmethod/latin/utils
parente581d8f8abc55dcf224678c73c7ce834170ee5e6 (diff)
parent281dd99346e2d45280143a22105a77ba91766703 (diff)
downloadlatinime-516c884b115f2cce1fca9a1599782ccfc433ca1f.tar.gz
latinime-516c884b115f2cce1fca9a1599782ccfc433ca1f.tar.xz
latinime-516c884b115f2cce1fca9a1599782ccfc433ca1f.zip
Merge "Prepare to implement distracter filter"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils')
-rw-r--r--java/src/com/android/inputmethod/latin/utils/DistracterFilter.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
new file mode 100644
index 000000000..f2a1e524d
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java
@@ -0,0 +1,48 @@
+/*
+ * 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.latin.utils;
+
+import com.android.inputmethod.keyboard.Keyboard;
+import com.android.inputmethod.latin.Suggest;
+
+/**
+ * This class is used to prevent distracters/misspellings being added to personalization
+ * or user history dictionaries
+ */
+public class DistracterFilter {
+ private final Suggest mSuggest;
+ private final Keyboard mKeyboard;
+
+ /**
+ * Create a DistracterFilter instance.
+ *
+ * @param suggest an instance of Suggest which will be used to obtain a list of suggestions
+ * for a potential distracter/misspelling
+ * @param keyboard the keyboard that is currently being used. This information is needed
+ * when calling mSuggest.getSuggestedWords(...) to obtain a list of suggestions.
+ */
+ public DistracterFilter(final Suggest suggest, final Keyboard keyboard) {
+ mSuggest = suggest;
+ mKeyboard = keyboard;
+ }
+
+ public boolean isDistractorToWordsInDictionaries(final String prevWord,
+ final String targetWord) {
+ // TODO: to be implemented
+ return false;
+ }
+}