diff options
-rw-r--r-- | dictionary/src/dictionary.cpp | 11 | ||||
-rw-r--r-- | dictionary/src/dictionary.h | 1 | ||||
-rw-r--r-- | res/values/strings.xml | 5 | ||||
-rwxr-xr-x | res/xml/kbd_symbols.xml | 9 | ||||
-rwxr-xr-x | res/xml/kbd_symbols_shift.xml | 15 |
5 files changed, 28 insertions, 13 deletions
diff --git a/dictionary/src/dictionary.cpp b/dictionary/src/dictionary.cpp index cc711f419..306aff527 100644 --- a/dictionary/src/dictionary.cpp +++ b/dictionary/src/dictionary.cpp @@ -51,6 +51,7 @@ Dictionary::~Dictionary() int Dictionary::getSuggestions(int *codes, int codesSize, unsigned short *outWords, int *frequencies, int maxWordLength, int maxWords, int maxAlternatives, int skipPos) { + int suggWords; mFrequencies = frequencies; mOutputChars = outWords; mInputCodes = codes; @@ -58,14 +59,16 @@ int Dictionary::getSuggestions(int *codes, int codesSize, unsigned short *outWor mMaxAlternatives = maxAlternatives; mMaxWordLength = maxWordLength; mMaxWords = maxWords; - mWords = 0; mSkipPos = skipPos; mMaxEditDistance = mInputLength < 5 ? 2 : mInputLength / 2; getWordsRec(0, 0, mInputLength * 3, false, 1, 0, 0); - if (DEBUG_DICT) LOGI("Returning %d words", mWords); - return mWords; + // Get the word count + suggWords = 0; + while (suggWords < mMaxWords && mFrequencies[suggWords] > 0) suggWords++; + if (DEBUG_DICT) LOGI("Returning %d words", suggWords); + return suggWords; } unsigned short @@ -138,8 +141,6 @@ Dictionary::addWord(unsigned short *word, int length, int frequency) *dest++ = *word++; } *dest = 0; // NULL terminate - // Update the word count - if (insertAt + 1 > mWords) mWords = insertAt + 1; if (DEBUG_DICT) LOGI("Added word at %d\n", insertAt); return true; } diff --git a/dictionary/src/dictionary.h b/dictionary/src/dictionary.h index 8f195ca9a..a12c035c8 100644 --- a/dictionary/src/dictionary.h +++ b/dictionary/src/dictionary.h @@ -60,7 +60,6 @@ private: int *mFrequencies; int mMaxWords; int mMaxWordLength; - int mWords; unsigned short *mOutputChars; int *mInputCodes; int mInputLength; diff --git a/res/values/strings.xml b/res/values/strings.xml index ec9a8b731..753d0dc9e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -126,7 +126,10 @@ <!-- Accented forms of "y" --> <string name="alternates_for_y">ýÿ</string> - <!-- Label to display on the "i" key --> + <!-- Label to display on the lower "i" key. + Usually you don't need to modify this value, but if your locale requires some variant + for this character (e.g. \\u131 "Latin Small Letter Dotoless i"), please modify this + value. --> <string name="key_i">i</string> <!-- Tip to long press on keys --> diff --git a/res/xml/kbd_symbols.xml b/res/xml/kbd_symbols.xml index f3b8833dc..48afd89a1 100755 --- a/res/xml/kbd_symbols.xml +++ b/res/xml/kbd_symbols.xml @@ -73,7 +73,7 @@ <Key android:codes="38" android:keyLabel="&"/> <Key android:codes="42" android:keyLabel="*" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="†‡" + android:popupCharacters="†‡⁂★" /> <Key android:codes="45" android:keyLabel="-" android:popupKeyboard="@xml/kbd_popup_template" @@ -105,7 +105,10 @@ android:popupKeyboard="@xml/kbd_popup_template" android:popupCharacters="“”«»˝" /> - <Key android:codes="39" android:keyLabel="\'"/> + <Key android:codes="39" android:keyLabel="\'" + android:popupKeyboard="@xml/kbd_popup_template" + android:popupCharacters="‘’" + /> <Key android:codes="58" android:keyLabel=":"/> <Key android:codes="59" android:keyLabel=";"/> <Key android:codes="47" android:keyLabel="/" /> @@ -136,4 +139,4 @@ android:iconPreview="@drawable/sym_keyboard_feedback_return" /> </Row> -</Keyboard>
\ No newline at end of file +</Keyboard> diff --git a/res/xml/kbd_symbols_shift.xml b/res/xml/kbd_symbols_shift.xml index 56428a3ad..d83594a24 100755 --- a/res/xml/kbd_symbols_shift.xml +++ b/res/xml/kbd_symbols_shift.xml @@ -29,7 +29,10 @@ <Key android:keyLabel="~" android:keyEdgeFlags="left"/> <Key android:keyLabel="`"/> <Key android:keyLabel="|"/> - <Key android:keyLabel="•"/> + <Key android:keyLabel="•" + android:popupKeyboard="@xml/kbd_popup_template" + android:popupCharacters="♪♥♠♦♣" + /> <Key android:keyLabel="√"/> <Key android:keyLabel="π"/> <Key android:keyLabel="÷"/> @@ -44,7 +47,10 @@ <Key android:keyLabel="¢"/> <Key android:keyLabel="€"/> <Key android:keyLabel="°"/> - <Key android:keyLabel="^"/> + <Key android:keyLabel="^" + android:popupKeyboard="@xml/kbd_popup_template" + android:popupCharacters="↑↓←→" + /> <Key android:keyLabel="_"/> <Key android:keyLabel="=" android:popupKeyboard="@xml/kbd_popup_template" @@ -61,7 +67,10 @@ <Key android:keyLabel="™"/> <Key android:keyLabel="®"/> <Key android:keyLabel="©"/> - <Key android:keyLabel="¶"/> + <Key android:keyLabel="¶" + android:popupKeyboard="@xml/kbd_popup_template" + android:popupCharacters="§" + /> <Key android:keyLabel="\\"/> <Key android:keyLabel="<" android:popupKeyboard="@xml/kbd_popup_template" |