Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80f2ccc2 authored by Jean Chalard's avatar Jean Chalard
Browse files

Update the names and default values of bigram options.

Bug: 6293595

Change-Id: I9978a1127c64b7a26a5ccf6f777366f7c4e214db
parent cb389ef0
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -22,17 +22,17 @@
    <bool name="config_use_fullscreen_mode">false</bool>
    <bool name="config_enable_show_voice_key_option">true</bool>
    <bool name="config_enable_show_popup_on_keypress_option">true</bool>
    <bool name="config_enable_bigram_suggestions_option">true</bool>
    <bool name="config_enable_next_word_suggestions_option">true</bool>
    <!-- TODO: Disable the following configuration for production. -->
    <bool name="config_enable_usability_study_mode_option">true</bool>
    <!-- Whether or not Popup on key press is enabled by default -->
    <bool name="config_default_popup_preview">true</bool>
    <!-- Default value for bigram suggestion: while showing suggestions for a word should we weigh
    <!-- Default value for next word suggestion: while showing suggestions for a word should we weigh
         in the previous word? -->
    <bool name="config_default_bigram_suggestions">true</bool>
    <!-- Default value for bigram prediction: after entering a word and a space only, should we look
    <bool name="config_default_next_word_suggestions">true</bool>
    <!-- Default value for next word prediction: after entering a word and a space only, should we look
         at input history to suggest a hopefully helpful suggestions for the next word? -->
    <bool name="config_default_bigram_prediction">false</bool>
    <bool name="config_default_next_word_prediction">true</bool>
    <bool name="config_default_sound_enabled">false</bool>
    <bool name="config_default_vibration_enabled">true</bool>
    <integer name="config_delay_update_suggestions">100</integer>
+7 −7
Original line number Diff line number Diff line
@@ -118,13 +118,13 @@
    <!-- Option to suggest auto correction suggestions very aggressively. Auto-corrects to a word which has even large edit distance from typed word. [CHAR LIMIT=20] -->
    <string name="auto_correction_threshold_mode_very_aggeressive">Very aggressive</string>

    <!-- Option to enable bigram correction -->
    <string name="bigram_suggestion">Bigram suggestions</string>
    <!-- Description for auto correction -->
    <string name="bigram_suggestion_summary">Use previous word to improve suggestion</string>
    <!-- Option to enable using user-history bigram when no input -->
    <string name="bigram_prediction">Bigram prediction</string>
    <!-- Description for auto correction -->
    <!-- Option to enable next word correction -->
    <string name="bigram_suggestion">Next word suggestions</string>
    <!-- Option to enable next word suggestion. This uses the previous word in an attempt to improve the suggestions quality -->
    <string name="bigram_suggestion_summary">Use previous word to improve suggestions</string>
    <!-- Option to enable using next word prediction -->
    <string name="bigram_prediction">Next word prediction</string>
    <!-- Description for "next word prediction" option. This displays suggestions even when there is no input, based on the previous word. -->
    <string name="bigram_prediction_summary">Use previous word also for prediction</string>

    <!-- Indicates that a word has been added to the dictionary -->
+4 −4
Original line number Diff line number Diff line
@@ -111,18 +111,18 @@
                android:persistent="true"
                android:defaultValue="true" />
            <CheckBoxPreference
                android:key="bigram_suggestion"
                android:key="next_word_suggestion"
                android:title="@string/bigram_suggestion"
                android:summary="@string/bigram_suggestion_summary"
                android:persistent="true"
                android:defaultValue="true" />
            <CheckBoxPreference
                android:key="bigram_prediction"
                android:dependency="bigram_suggestion"
                android:key="next_word_prediction"
                android:dependency="next_word_suggestion"
                android:title="@string/bigram_prediction"
                android:summary="@string/bigram_prediction_summary"
                android:persistent="true"
                android:defaultValue="false" />
                android:defaultValue="true" />
            <CheckBoxPreference
                android:key="enable_span_insert"
                android:title="@string/enable_span_insert"
+3 −3
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ public class Settings extends InputMethodSettingsActivity
    public static final String PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY =
            "pref_key_preview_popup_dismiss_delay";
    public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict";
    public static final String PREF_BIGRAM_SUGGESTION = "bigram_suggestion";
    public static final String PREF_BIGRAM_PREDICTIONS = "bigram_prediction";
    public static final String PREF_BIGRAM_SUGGESTION = "next_word_suggestion";
    public static final String PREF_BIGRAM_PREDICTIONS = "next_word_prediction";
    public static final String PREF_KEY_ENABLE_SPAN_INSERT = "enable_span_insert";
    public static final String PREF_VIBRATION_DURATION_SETTINGS =
            "pref_vibration_duration_settings";
@@ -167,7 +167,7 @@ public class Settings extends InputMethodSettingsActivity
        }

        final boolean showBigramSuggestionsOption = res.getBoolean(
                R.bool.config_enable_bigram_suggestions_option);
                R.bool.config_enable_next_word_suggestions_option);
        if (!showBigramSuggestionsOption) {
            textCorrectionGroup.removePreference(mBigramSuggestion);
            if (null != mBigramPrediction) {
+3 −3
Original line number Diff line number Diff line
@@ -236,18 +236,18 @@ public class SettingsValues {
    private static boolean isBigramSuggestionEnabled(final SharedPreferences sp,
            final Resources resources, final boolean autoCorrectEnabled) {
        final boolean showBigramSuggestionsOption = resources.getBoolean(
                R.bool.config_enable_bigram_suggestions_option);
                R.bool.config_enable_next_word_suggestions_option);
        if (!showBigramSuggestionsOption) {
            return autoCorrectEnabled;
        }
        return sp.getBoolean(Settings.PREF_BIGRAM_SUGGESTION, resources.getBoolean(
                R.bool.config_default_bigram_suggestions));
                R.bool.config_default_next_word_suggestions));
    }

    private static boolean isBigramPredictionEnabled(final SharedPreferences sp,
            final Resources resources) {
        return sp.getBoolean(Settings.PREF_BIGRAM_PREDICTIONS, resources.getBoolean(
                R.bool.config_default_bigram_prediction));
                R.bool.config_default_next_word_prediction));
    }

    private static double getAutoCorrectionThreshold(final Resources resources,