Increase target size of preferred letters while typing.
This increases the chance of hitting the correct letter when typing a word
that exists in the dictionary, rather than only correct it after the fact.
It is most effective after 2 or 3 letters of a word have been typed and gets
more accurate with more typed letters in the word.
If 2 adjacent letters have similar probabilities of occuring, then there is no
hit correction applied.
diff --git a/dictionary/src/dictionary.h b/dictionary/src/dictionary.h
index a12c035..3749f3d 100644
--- a/dictionary/src/dictionary.h
+++ b/dictionary/src/dictionary.h
@@ -32,7 +32,8 @@
public:
Dictionary(void *dict, int typedLetterMultipler, int fullWordMultiplier);
int getSuggestions(int *codes, int codesSize, unsigned short *outWords, int *frequencies,
- int maxWordLength, int maxWords, int maxAlternatives, int skipPos);
+ int maxWordLength, int maxWords, int maxAlternatives, int skipPos,
+ int *nextLetters, int nextLettersSize);
bool isValidWord(unsigned short *word, int length);
void setAsset(void *asset) { mAsset = asset; }
void *getAsset() { return mAsset; }
@@ -53,6 +54,7 @@
void getWordsRec(int pos, int depth, int maxDepth, bool completion, int frequency,
int inputIndex, int diffs);
bool isValidWordRec(int pos, unsigned short *word, int offset, int length);
+ void registerNextLetter(unsigned short c);
unsigned char *mDict;
void *mAsset;
@@ -70,6 +72,8 @@
int mFullWordMultiplier;
int mTypedLetterMultiplier;
+ int *mNextLettersFrequencies;
+ int mNextLettersSize;
};
// ----------------------------------------------------------------------------