diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index e71d9517c..550e71ada 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -103,6 +103,13 @@
android:title="@string/gesture_preview_trail"
android:defaultValue="true"
android:persistent="true" />
+
getSuggestions(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight) {
if (!isValidDictionary()) {
return null;
@@ -279,8 +280,12 @@ public final class BinaryDictionary extends Dictionary {
}
session.mNativeSuggestOptions.setUseFullEditDistance(mUseFullEditDistance);
session.mNativeSuggestOptions.setIsGesture(isGesture);
- session.mNativeSuggestOptions.setBlockOffensiveWords(blockOffensiveWords);
- session.mNativeSuggestOptions.setAdditionalFeaturesOptions(additionalFeaturesOptions);
+ session.mNativeSuggestOptions.setBlockOffensiveWords(
+ settingsValuesForSuggestion.mBlockPotentiallyOffensive);
+ session.mNativeSuggestOptions.setSpaceAwareGestureEnabled(
+ settingsValuesForSuggestion.mSpaceAwareGestureEnabled);
+ session.mNativeSuggestOptions.setAdditionalFeaturesOptions(
+ settingsValuesForSuggestion.mAdditionalFeaturesSettingValues);
if (inOutLanguageWeight != null) {
session.mInputOutputLanguageWeight[0] = inOutLanguageWeight[0];
} else {
diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java
index b55ed125f..560ced9c4 100644
--- a/java/src/com/android/inputmethod/latin/Dictionary.java
+++ b/java/src/com/android/inputmethod/latin/Dictionary.java
@@ -19,6 +19,7 @@ package com.android.inputmethod.latin;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import java.util.ArrayList;
@@ -72,8 +73,7 @@ public abstract class Dictionary {
* @param composer the key sequence to match with coordinate info, as a WordComposer
* @param prevWordsInfo the information of previous words.
* @param proximityInfo the object for key proximity. May be ignored by some implementations.
- * @param blockOffensiveWords whether to block potentially offensive words
- * @param additionalFeaturesOptions options about additional features used for the suggestion.
+ * @param settingsValuesForSuggestion the settings values used for the suggestion.
* @param sessionId the session id.
* @param inOutLanguageWeight the language weight used for generating suggestions.
* inOutLanguageWeight is a float array that has only one element. This can be updated when the
@@ -82,7 +82,7 @@ public abstract class Dictionary {
*/
abstract public ArrayList getSuggestions(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight);
/**
@@ -168,7 +168,7 @@ public abstract class Dictionary {
@Override
public ArrayList getSuggestions(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight) {
return null;
}
diff --git a/java/src/com/android/inputmethod/latin/DictionaryCollection.java b/java/src/com/android/inputmethod/latin/DictionaryCollection.java
index 89d61ce2a..2b4c54d48 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryCollection.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryCollection.java
@@ -20,6 +20,7 @@ import android.util.Log;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import java.util.ArrayList;
import java.util.Collection;
@@ -57,21 +58,21 @@ public final class DictionaryCollection extends Dictionary {
@Override
public ArrayList getSuggestions(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight) {
final CopyOnWriteArrayList dictionaries = mDictionaries;
if (dictionaries.isEmpty()) return null;
// To avoid creating unnecessary objects, we get the list out of the first
// dictionary and add the rest to it if not null, hence the get(0)
ArrayList suggestions = dictionaries.get(0).getSuggestions(composer,
- prevWordsInfo, proximityInfo, blockOffensiveWords, additionalFeaturesOptions,
- sessionId, inOutLanguageWeight);
+ prevWordsInfo, proximityInfo, settingsValuesForSuggestion, sessionId,
+ inOutLanguageWeight);
if (null == suggestions) suggestions = new ArrayList<>();
final int length = dictionaries.size();
for (int i = 1; i < length; ++ i) {
final ArrayList sugg = dictionaries.get(i).getSuggestions(composer,
- prevWordsInfo, proximityInfo, blockOffensiveWords, additionalFeaturesOptions,
- sessionId, inOutLanguageWeight);
+ prevWordsInfo, proximityInfo, settingsValuesForSuggestion, sessionId,
+ inOutLanguageWeight);
if (null != sugg) suggestions.addAll(sugg);
}
return suggestions;
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
index b8feb2278..d6e6656ab 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
@@ -29,6 +29,7 @@ import com.android.inputmethod.latin.personalization.ContextualDictionary;
import com.android.inputmethod.latin.personalization.PersonalizationDataChunk;
import com.android.inputmethod.latin.personalization.PersonalizationDictionary;
import com.android.inputmethod.latin.personalization.UserHistoryDictionary;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.settings.SpacingAndPunctuations;
import com.android.inputmethod.latin.utils.DistracterFilter;
import com.android.inputmethod.latin.utils.DistracterFilterCheckingIsInDictionary;
@@ -486,8 +487,7 @@ public class DictionaryFacilitator {
// TODO: Revise the way to fusion suggestion results.
public SuggestionResults getSuggestionResults(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
- final int sessionId) {
+ final SettingsValuesForSuggestion settingsValuesForSuggestion, final int sessionId) {
final Dictionaries dictionaries = mDictionaries;
final SuggestionResults suggestionResults =
new SuggestionResults(dictionaries.mLocale, SuggestedWords.MAX_SUGGESTIONS);
@@ -497,8 +497,7 @@ public class DictionaryFacilitator {
if (null == dictionary) continue;
final ArrayList dictionarySuggestions =
dictionary.getSuggestions(composer, prevWordsInfo, proximityInfo,
- blockOffensiveWords, additionalFeaturesOptions, sessionId,
- languageWeight);
+ settingsValuesForSuggestion, sessionId, languageWeight);
if (null == dictionarySuggestions) continue;
suggestionResults.addAll(dictionarySuggestions);
if (null != suggestionResults.mRawSuggestions) {
diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
index 37879cf68..5808b9e4e 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
@@ -26,6 +26,7 @@ import com.android.inputmethod.latin.makedict.FormatSpec;
import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
import com.android.inputmethod.latin.makedict.WordProperty;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.utils.CombinedFormatUtils;
import com.android.inputmethod.latin.utils.DistracterFilter;
import com.android.inputmethod.latin.utils.ExecutorUtils;
@@ -409,8 +410,8 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
@Override
public ArrayList getSuggestions(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
- final int sessionId, final float[] inOutLanguageWeight) {
+ final SettingsValuesForSuggestion settingsValuesForSuggestion, final int sessionId,
+ final float[] inOutLanguageWeight) {
reloadDictionaryIfRequired();
boolean lockAcquired = false;
try {
@@ -422,8 +423,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
}
final ArrayList suggestions =
mBinaryDictionary.getSuggestions(composer, prevWordsInfo, proximityInfo,
- blockOffensiveWords, additionalFeaturesOptions, sessionId,
- inOutLanguageWeight);
+ settingsValuesForSuggestion, sessionId, inOutLanguageWeight);
if (mBinaryDictionary.isCorrupted()) {
Log.i(TAG, "Dictionary (" + mDictName +") is corrupted. "
+ "Remove and regenerate it.");
diff --git a/java/src/com/android/inputmethod/latin/ReadOnlyBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ReadOnlyBinaryDictionary.java
index e59ef7563..5d4fc5861 100644
--- a/java/src/com/android/inputmethod/latin/ReadOnlyBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ReadOnlyBinaryDictionary.java
@@ -18,6 +18,7 @@ package com.android.inputmethod.latin;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import java.util.ArrayList;
import java.util.Locale;
@@ -51,13 +52,12 @@ public final class ReadOnlyBinaryDictionary extends Dictionary {
@Override
public ArrayList getSuggestions(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight) {
if (mLock.readLock().tryLock()) {
try {
return mBinaryDictionary.getSuggestions(composer, prevWordsInfo, proximityInfo,
- blockOffensiveWords, additionalFeaturesOptions, sessionId,
- inOutLanguageWeight);
+ settingsValuesForSuggestion, sessionId, inOutLanguageWeight);
} finally {
mLock.readLock().unlock();
}
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index c347f69a9..838e34f4e 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -20,7 +20,7 @@ import android.text.TextUtils;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
-import com.android.inputmethod.latin.define.ProductionFlag;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.utils.AutoCorrectionUtils;
import com.android.inputmethod.latin.utils.BinaryDictionaryUtils;
import com.android.inputmethod.latin.utils.StringUtils;
@@ -73,17 +73,15 @@ public final class Suggest {
public void getSuggestedWords(final WordComposer wordComposer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final boolean isCorrectionEnabled,
- final int[] additionalFeaturesOptions, final int sessionId, final int sequenceNumber,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
+ final boolean isCorrectionEnabled, final int sessionId, final int sequenceNumber,
final OnGetSuggestedWordsCallback callback) {
if (wordComposer.isBatchMode()) {
getSuggestedWordsForBatchInput(wordComposer, prevWordsInfo, proximityInfo,
- blockOffensiveWords, additionalFeaturesOptions, sessionId, sequenceNumber,
- callback);
+ settingsValuesForSuggestion, sessionId, sequenceNumber, callback);
} else {
getSuggestedWordsForTypingInput(wordComposer, prevWordsInfo, proximityInfo,
- blockOffensiveWords, isCorrectionEnabled, additionalFeaturesOptions,
- sequenceNumber, callback);
+ settingsValuesForSuggestion, isCorrectionEnabled, sequenceNumber, callback);
}
}
@@ -125,8 +123,8 @@ public final class Suggest {
// and calls the callback function with the suggestions.
private void getSuggestedWordsForTypingInput(final WordComposer wordComposer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final boolean isCorrectionEnabled,
- final int[] additionalFeaturesOptions, final int sequenceNumber,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
+ final boolean isCorrectionEnabled, final int sequenceNumber,
final OnGetSuggestedWordsCallback callback) {
final String typedWord = wordComposer.getTypedWord();
final int trailingSingleQuotesCount = StringUtils.getTrailingSingleQuotesCount(typedWord);
@@ -135,8 +133,8 @@ public final class Suggest {
: typedWord;
final SuggestionResults suggestionResults = mDictionaryFacilitator.getSuggestionResults(
- wordComposer, prevWordsInfo, proximityInfo, blockOffensiveWords,
- additionalFeaturesOptions, SESSION_TYPING);
+ wordComposer, prevWordsInfo, proximityInfo, settingsValuesForSuggestion,
+ SESSION_TYPING);
final ArrayList suggestionsContainer =
getTransformedSuggestedWordInfoList(wordComposer, suggestionResults,
trailingSingleQuotesCount);
@@ -205,12 +203,11 @@ public final class Suggest {
// and calls the callback function with the suggestions.
private void getSuggestedWordsForBatchInput(final WordComposer wordComposer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final int sequenceNumber,
final OnGetSuggestedWordsCallback callback) {
final SuggestionResults suggestionResults = mDictionaryFacilitator.getSuggestionResults(
- wordComposer, prevWordsInfo, proximityInfo, blockOffensiveWords,
- additionalFeaturesOptions, sessionId);
+ wordComposer, prevWordsInfo, proximityInfo, settingsValuesForSuggestion, sessionId);
final ArrayList suggestionsContainer =
new ArrayList<>(suggestionResults);
final int suggestionsCount = suggestionsContainer.size();
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 5ab7db8ce..929720b49 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -46,6 +46,7 @@ import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.WordComposer;
import com.android.inputmethod.latin.settings.SettingsValues;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.settings.SpacingAndPunctuations;
import com.android.inputmethod.latin.suggestions.SuggestionStripViewAccessor;
import com.android.inputmethod.latin.utils.AsyncResultHolder;
@@ -1998,9 +1999,11 @@ public final class InputLogic {
// a word, it's whatever is *before* the half-committed word in the buffer,
// hence 2; if we aren't, we should just skip whitespace if any, so 1.
mWordComposer.isComposingWord() ? 2 : 1),
- proximityInfo, settingsValues.mBlockPotentiallyOffensive,
+ proximityInfo,
+ new SettingsValuesForSuggestion(settingsValues.mBlockPotentiallyOffensive,
+ settingsValues.mPhraseGestureEnabled,
+ settingsValues.mAdditionalFeaturesSettingValues),
settingsValues.mAutoCorrectionEnabled,
- settingsValues.mAdditionalFeaturesSettingValues,
sessionId, sequenceNumber, callback);
}
}
diff --git a/java/src/com/android/inputmethod/latin/settings/NativeSuggestOptions.java b/java/src/com/android/inputmethod/latin/settings/NativeSuggestOptions.java
index 04a2ee3ce..31a20c4db 100644
--- a/java/src/com/android/inputmethod/latin/settings/NativeSuggestOptions.java
+++ b/java/src/com/android/inputmethod/latin/settings/NativeSuggestOptions.java
@@ -21,7 +21,8 @@ public class NativeSuggestOptions {
private static final int IS_GESTURE = 0;
private static final int USE_FULL_EDIT_DISTANCE = 1;
private static final int BLOCK_OFFENSIVE_WORDS = 2;
- private static final int OPTIONS_SIZE = 3;
+ private static final int SPACE_AWARE_GESTURE_ENABLED = 3;
+ private static final int OPTIONS_SIZE = 4;
private final int[] mOptions = new int[OPTIONS_SIZE
+ AdditionalFeaturesSettingUtils.ADDITIONAL_FEATURES_SETTINGS_SIZE];
@@ -38,6 +39,10 @@ public class NativeSuggestOptions {
setBooleanOption(BLOCK_OFFENSIVE_WORDS, value);
}
+ public void setSpaceAwareGestureEnabled(final boolean value) {
+ setBooleanOption(SPACE_AWARE_GESTURE_ENABLED, value);
+ }
+
public void setAdditionalFeaturesOptions(final int[] additionalOptions) {
if (additionalOptions == null) {
return;
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValuesForSuggestion.java b/java/src/com/android/inputmethod/latin/settings/SettingsValuesForSuggestion.java
new file mode 100644
index 000000000..d80af4ba7
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValuesForSuggestion.java
@@ -0,0 +1,30 @@
+/*
+ * 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.settings;
+
+public class SettingsValuesForSuggestion {
+ public final boolean mBlockPotentiallyOffensive;
+ public final boolean mSpaceAwareGestureEnabled;
+ public final int[] mAdditionalFeaturesSettingValues;
+
+ public SettingsValuesForSuggestion(final boolean blockPotentiallyOffensive,
+ final boolean spaceAwareGestureEnabled, final int[] additionalFeaturesSettingValues) {
+ mBlockPotentiallyOffensive = blockPotentiallyOffensive;
+ mSpaceAwareGestureEnabled = spaceAwareGestureEnabled;
+ mAdditionalFeaturesSettingValues = additionalFeaturesSettingValues;
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
index 4825b9e2c..08adaf844 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
@@ -33,6 +33,7 @@ import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.PrevWordsInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.WordComposer;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService.SuggestionsGatherer;
import com.android.inputmethod.latin.utils.CoordinateUtils;
import com.android.inputmethod.latin.utils.LocaleUtils;
@@ -308,8 +309,12 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
// TODO: make a spell checker option to block offensive words or not
final ArrayList suggestions =
dictInfo.mDictionary.getSuggestions(composer, prevWordsInfo,
- dictInfo.getProximityInfo(), true /* blockOffensiveWords */,
- null /* additionalFeaturesOptions */, 0 /* sessionId */,
+ dictInfo.getProximityInfo(),
+ new SettingsValuesForSuggestion(
+ true /* blockPotentiallyOffensive */,
+ true /* spaceAwareGestureEnabled */,
+ null /* additionalFeaturesSettingValues */),
+ 0 /* sessionId */,
null /* inOutLanguageWeight */);
if (suggestions != null) {
for (final SuggestedWordInfo suggestion : suggestions) {
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java b/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java
index cc52a3e0f..eb85d4969 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java
@@ -22,6 +22,7 @@ import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.PrevWordsInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.WordComposer;
import java.util.ArrayList;
@@ -53,7 +54,7 @@ public final class DictionaryPool extends LinkedBlockingQueue {
@Override
public ArrayList getSuggestions(final WordComposer composer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight) {
return noSuggestions;
}
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedContactsBinaryDictionary.java b/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedContactsBinaryDictionary.java
index a6437bac3..688b184cb 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedContactsBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedContactsBinaryDictionary.java
@@ -22,6 +22,7 @@ import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.ContactsBinaryDictionary;
import com.android.inputmethod.latin.PrevWordsInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.WordComposer;
import java.util.ArrayList;
@@ -38,11 +39,11 @@ public final class SynchronouslyLoadedContactsBinaryDictionary extends ContactsB
@Override
public ArrayList getSuggestions(final WordComposer codes,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight) {
synchronized (mLock) {
return super.getSuggestions(codes, prevWordsInfo, proximityInfo,
- blockOffensiveWords, additionalFeaturesOptions, sessionId, inOutLanguageWeight);
+ settingsValuesForSuggestion, sessionId, inOutLanguageWeight);
}
}
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java
index 8c9d5d681..ff71f59f8 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java
@@ -21,6 +21,7 @@ import android.content.Context;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.PrevWordsInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.UserBinaryDictionary;
import com.android.inputmethod.latin.WordComposer;
@@ -43,11 +44,11 @@ public final class SynchronouslyLoadedUserBinaryDictionary extends UserBinaryDic
@Override
public ArrayList getSuggestions(final WordComposer codes,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final boolean blockOffensiveWords, final int[] additionalFeaturesOptions,
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
final int sessionId, final float[] inOutLanguageWeight) {
synchronized (mLock) {
return super.getSuggestions(codes, prevWordsInfo, proximityInfo,
- blockOffensiveWords, additionalFeaturesOptions, sessionId, inOutLanguageWeight);
+ settingsValuesForSuggestion, sessionId, inOutLanguageWeight);
}
}
diff --git a/native/jni/src/suggest/core/suggest_options.h b/native/jni/src/suggest/core/suggest_options.h
index 2e22a7ac3..d456680dd 100644
--- a/native/jni/src/suggest/core/suggest_options.h
+++ b/native/jni/src/suggest/core/suggest_options.h
@@ -38,6 +38,10 @@ class SuggestOptions{
return getBoolOption(BLOCK_OFFENSIVE_WORDS);
}
+ AK_FORCE_INLINE bool enableSpaceAwareGesture() const {
+ return getBoolOption(SPACE_AWARE_GESTURE_ENABLED);
+ }
+
AK_FORCE_INLINE bool getAdditionalFeaturesBoolOption(const int key) const {
return getBoolOption(key + ADDITIONAL_FEATURES_OPTIONS);
}
@@ -50,9 +54,10 @@ class SuggestOptions{
static const int IS_GESTURE = 0;
static const int USE_FULL_EDIT_DISTANCE = 1;
static const int BLOCK_OFFENSIVE_WORDS = 2;
+ static const int SPACE_AWARE_GESTURE_ENABLED = 3;
// Additional features options are stored after the other options and used as setting values of
// experimental features.
- static const int ADDITIONAL_FEATURES_OPTIONS = 3;
+ static const int ADDITIONAL_FEATURES_OPTIONS = 4;
const int *const mOptions;
const int mLength;
diff --git a/tools/dicttool/Android.mk b/tools/dicttool/Android.mk
index ce51df1eb..22ed7b7a7 100644
--- a/tools/dicttool/Android.mk
+++ b/tools/dicttool/Android.mk
@@ -50,6 +50,7 @@ LATINIME_SRC_FILES_FOR_DICTTOOL := \
latin/SuggestedWords.java \
latin/WordComposer.java \
latin/settings/NativeSuggestOptions.java \
+ latin/settings/SettingsValuesForSuggestion.java \
latin/utils/BinaryDictionaryUtils.java \
latin/utils/CombinedFormatUtils.java \
latin/utils/CoordinateUtils.java \