aboutsummaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
Diffstat (limited to 'native/src')
-rw-r--r--native/src/bigram_dictionary.cpp3
-rw-r--r--native/src/defines.h8
-rw-r--r--native/src/proximity_info.cpp95
-rw-r--r--native/src/proximity_info.h6
-rw-r--r--native/src/unigram_dictionary.cpp97
-rw-r--r--native/src/unigram_dictionary.h17
6 files changed, 129 insertions, 97 deletions
diff --git a/native/src/bigram_dictionary.cpp b/native/src/bigram_dictionary.cpp
index fa69de854..3704c47e6 100644
--- a/native/src/bigram_dictionary.cpp
+++ b/native/src/bigram_dictionary.cpp
@@ -151,8 +151,9 @@ bool BigramDictionary::checkFirstCharacter(unsigned short *word) {
int *inputCodes = mInputCodes;
int maxAlt = MAX_ALTERNATIVES;
+ const unsigned short firstBaseChar = toBaseLowerCase(*word);
while (maxAlt > 0) {
- if ((unsigned int) *inputCodes == (unsigned int) *word) {
+ if (toBaseLowerCase(*inputCodes) == firstBaseChar) {
return true;
}
inputCodes++;
diff --git a/native/src/defines.h b/native/src/defines.h
index b0dbffa0f..e882c3714 100644
--- a/native/src/defines.h
+++ b/native/src/defines.h
@@ -171,7 +171,7 @@ static inline void prof_out(void) {
#define EQUIVALENT_CHAR_WITHOUT_DISTANCE_INFO -2
#define PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO -3
#define ADDITIONAL_PROXIMITY_CHAR_DISTANCE_INFO -4
-#define NOT_A_INDEX -1
+#define NOT_AN_INDEX -1
#define NOT_A_FREQUENCY -1
#define KEYCODE_SPACE ' '
@@ -232,9 +232,9 @@ static inline void prof_out(void) {
#define FIRST_WORD_INDEX 0
-// TODO: Reduce this constant if possible; check the maximum number of umlauts in the same German
-// word in the dictionary
-#define DEFAULT_MAX_UMLAUT_SEARCH_DEPTH 5
+// TODO: Reduce this constant if possible; check the maximum number of digraphs in the same
+// word in the dictionary for languages with digraphs, like German and French
+#define DEFAULT_MAX_DIGRAPH_SEARCH_DEPTH 5
// Minimum suggest depth for one word for all cases except for missing space suggestions.
#define MIN_SUGGEST_DEPTH 1
diff --git a/native/src/proximity_info.cpp b/native/src/proximity_info.cpp
index 4d03f3274..c00c4c20f 100644
--- a/native/src/proximity_info.cpp
+++ b/native/src/proximity_info.cpp
@@ -129,7 +129,8 @@ bool ProximityInfo::hasSpaceProximity(const int x, const int y) const {
return false;
}
-bool ProximityInfo::isOnKey(const int keyId, const int x, const int y) {
+bool ProximityInfo::isOnKey(const int keyId, const int x, const int y) const {
+ if (keyId < 0) return true; // NOT_A_ID is -1, but return whenever < 0 just in case
const int left = mKeyXCoordinates[keyId];
const int top = mKeyYCoordinates[keyId];
const int right = left + mKeyWidths[keyId] + 1;
@@ -137,7 +138,8 @@ bool ProximityInfo::isOnKey(const int keyId, const int x, const int y) {
return left < right && top < bottom && x >= left && x < right && y >= top && y < bottom;
}
-int ProximityInfo::squaredDistanceToEdge(const int keyId, const int x, const int y) {
+int ProximityInfo::squaredDistanceToEdge(const int keyId, const int x, const int y) const {
+ if (keyId < 0) return true; // NOT_A_ID is -1, but return whenever < 0 just in case
const int left = mKeyXCoordinates[keyId];
const int top = mKeyYCoordinates[keyId];
const int right = left + mKeyWidths[keyId];
@@ -150,58 +152,60 @@ int ProximityInfo::squaredDistanceToEdge(const int keyId, const int x, const int
}
void ProximityInfo::calculateNearbyKeyCodes(
- const int x, const int y, const int32_t primaryKey, int *inputCodes) {
+ const int x, const int y, const int32_t primaryKey, int *inputCodes) const {
int insertPos = 0;
inputCodes[insertPos++] = primaryKey;
const int startIndex = getStartIndexFromCoordinates(x, y);
- for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {
- const int32_t c = mProximityCharsArray[startIndex + i];
- if (c < KEYCODE_SPACE || c == primaryKey) {
- continue;
+ if (startIndex >= 0) {
+ for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {
+ const int32_t c = mProximityCharsArray[startIndex + i];
+ if (c < KEYCODE_SPACE || c == primaryKey) {
+ continue;
+ }
+ const int keyIndex = getKeyIndex(c);
+ const bool onKey = isOnKey(keyIndex, x, y);
+ const int distance = squaredDistanceToEdge(keyIndex, x, y);
+ if (onKey || distance < MOST_COMMON_KEY_WIDTH_SQUARE) {
+ inputCodes[insertPos++] = c;
+ if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
+ if (DEBUG_DICT) {
+ assert(false);
+ }
+ return;
+ }
+ }
}
- const int keyIndex = getKeyIndex(c);
- const bool onKey = isOnKey(keyIndex, x, y);
- const int distance = squaredDistanceToEdge(keyIndex, x, y);
- if (c >= KEYCODE_SPACE && (onKey || distance < MOST_COMMON_KEY_WIDTH_SQUARE)) {
- inputCodes[insertPos++] = c;
+ const int additionalProximitySize =
+ AdditionalProximityChars::getAdditionalCharsSize(&mLocaleStr, primaryKey);
+ if (additionalProximitySize > 0) {
+ inputCodes[insertPos++] = ADDITIONAL_PROXIMITY_CHAR_DELIMITER_CODE;
if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
if (DEBUG_DICT) {
assert(false);
}
return;
}
- }
- }
- const int additionalProximitySize =
- AdditionalProximityChars::getAdditionalCharsSize(&mLocaleStr, primaryKey);
- if (additionalProximitySize > 0) {
- inputCodes[insertPos++] = ADDITIONAL_PROXIMITY_CHAR_DELIMITER_CODE;
- if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
- if (DEBUG_DICT) {
- assert(false);
- }
- return;
- }
- const int32_t* additionalProximityChars =
- AdditionalProximityChars::getAdditionalChars(&mLocaleStr, primaryKey);
- for (int j = 0; j < additionalProximitySize; ++j) {
- const int32_t ac = additionalProximityChars[j];
- int k = 0;
- for (; k < insertPos; ++k) {
- if ((int)ac == inputCodes[k]) {
- break;
+ const int32_t* additionalProximityChars =
+ AdditionalProximityChars::getAdditionalChars(&mLocaleStr, primaryKey);
+ for (int j = 0; j < additionalProximitySize; ++j) {
+ const int32_t ac = additionalProximityChars[j];
+ int k = 0;
+ for (; k < insertPos; ++k) {
+ if ((int)ac == inputCodes[k]) {
+ break;
+ }
}
- }
- if (k < insertPos) {
- continue;
- }
- inputCodes[insertPos++] = ac;
- if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
- if (DEBUG_DICT) {
- assert(false);
+ if (k < insertPos) {
+ continue;
+ }
+ inputCodes[insertPos++] = ac;
+ if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
+ if (DEBUG_DICT) {
+ assert(false);
+ }
+ return;
}
- return;
}
}
}
@@ -211,14 +215,13 @@ void ProximityInfo::calculateNearbyKeyCodes(
}
}
-// TODO: Calculate nearby codes here.
void ProximityInfo::setInputParams(const int32_t* inputCodes, const int inputLength,
const int* xCoordinates, const int* yCoordinates) {
memset(mInputCodes, 0,
MAX_WORD_LENGTH_INTERNAL * MAX_PROXIMITY_CHARS_SIZE * sizeof(mInputCodes[0]));
for (int i = 0; i < inputLength; ++i) {
- const int32_t primaryKey = inputCodes[i * MAX_PROXIMITY_CHARS_SIZE];
+ const int32_t primaryKey = inputCodes[i];
const int x = xCoordinates[i];
const int y = yCoordinates[i];
int *proximities = &mInputCodes[i * MAX_PROXIMITY_CHARS_SIZE];
@@ -303,7 +306,7 @@ inline float square(const float x) { return x * x; }
float ProximityInfo::calculateNormalizedSquaredDistance(
const int keyIndex, const int inputIndex) const {
- if (keyIndex == NOT_A_INDEX) {
+ if (keyIndex == NOT_AN_INDEX) {
return NOT_A_DISTANCE_FLOAT;
}
if (!hasSweetSpotData(keyIndex)) {
@@ -324,11 +327,11 @@ bool ProximityInfo::hasInputCoordinates() const {
int ProximityInfo::getKeyIndex(const int c) const {
if (KEY_COUNT == 0) {
// We do not have the coordinate data
- return NOT_A_INDEX;
+ return NOT_AN_INDEX;
}
const unsigned short baseLowerC = toBaseLowerCase(c);
if (baseLowerC > MAX_CHAR_CODE) {
- return NOT_A_INDEX;
+ return NOT_AN_INDEX;
}
return mCodeToKeyIndex[baseLowerC];
}
diff --git a/native/src/proximity_info.h b/native/src/proximity_info.h
index cdc5a3d43..c1eefeacc 100644
--- a/native/src/proximity_info.h
+++ b/native/src/proximity_info.h
@@ -92,10 +92,10 @@ class ProximityInfo {
// the radius of the key is assigned to zero.
return mSweetSpotRadii[keyIndex] > 0.0;
}
- bool isOnKey(const int keyId, const int x, const int y);
- int squaredDistanceToEdge(const int keyId, const int x, const int y);
+ bool isOnKey(const int keyId, const int x, const int y) const;
+ int squaredDistanceToEdge(const int keyId, const int x, const int y) const;
void calculateNearbyKeyCodes(
- const int x, const int y, const int32_t primaryKey, int *inputCodes);
+ const int x, const int y, const int32_t primaryKey, int *inputCodes) const;
const int MAX_PROXIMITY_CHARS_SIZE;
const int KEYBOARD_WIDTH;
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp
index 6c2c89231..d21413d8b 100644
--- a/native/src/unigram_dictionary.cpp
+++ b/native/src/unigram_dictionary.cpp
@@ -30,21 +30,25 @@
namespace latinime {
const UnigramDictionary::digraph_t UnigramDictionary::GERMAN_UMLAUT_DIGRAPHS[] =
- { { 'a', 'e' },
- { 'o', 'e' },
- { 'u', 'e' } };
+ { { 'a', 'e', 0x00E4 }, // U+00E4 : LATIN SMALL LETTER A WITH DIAERESIS
+ { 'o', 'e', 0x00F6 }, // U+00F6 : LATIN SMALL LETTER O WITH DIAERESIS
+ { 'u', 'e', 0x00FC } }; // U+00FC : LATIN SMALL LETTER U WITH DIAERESIS
+
+const UnigramDictionary::digraph_t UnigramDictionary::FRENCH_LIGATURES_DIGRAPHS[] =
+ { { 'a', 'e', 0x00E6 }, // U+00E6 : LATIN SMALL LETTER AE
+ { 'o', 'e', 0x0153 } }; // U+0153 : LATIN SMALL LIGATURE OE
// TODO: check the header
UnigramDictionary::UnigramDictionary(const uint8_t* const streamStart, int typedLetterMultiplier,
int fullWordMultiplier, int maxWordLength, int maxWords, int maxProximityChars,
const bool isLatestDictVersion)
: DICT_ROOT(streamStart), MAX_WORD_LENGTH(maxWordLength), MAX_WORDS(maxWords),
- MAX_PROXIMITY_CHARS(maxProximityChars), IS_LATEST_DICT_VERSION(isLatestDictVersion),
+ IS_LATEST_DICT_VERSION(isLatestDictVersion),
TYPED_LETTER_MULTIPLIER(typedLetterMultiplier), FULL_WORD_MULTIPLIER(fullWordMultiplier),
// TODO : remove this variable.
ROOT_POS(0),
- BYTES_IN_ONE_CHAR(MAX_PROXIMITY_CHARS * sizeof(int)),
- MAX_UMLAUT_SEARCH_DEPTH(DEFAULT_MAX_UMLAUT_SEARCH_DEPTH) {
+ BYTES_IN_ONE_CHAR(sizeof(int)),
+ MAX_DIGRAPH_SEARCH_DEPTH(DEFAULT_MAX_DIGRAPH_SEARCH_DEPTH) {
if (DEBUG_DICT) {
AKLOGI("UnigramDictionary - constructor");
}
@@ -53,9 +57,8 @@ UnigramDictionary::UnigramDictionary(const uint8_t* const streamStart, int typed
UnigramDictionary::~UnigramDictionary() {
}
-static inline unsigned int getCodesBufferSize(const int *codes, const int codesSize,
- const int MAX_PROXIMITY_CHARS) {
- return sizeof(*codes) * MAX_PROXIMITY_CHARS * codesSize;
+static inline unsigned int getCodesBufferSize(const int *codes, const int codesSize) {
+ return sizeof(*codes) * codesSize;
}
// TODO: This needs to take a const unsigned short* and not tinker with its contents
@@ -64,23 +67,28 @@ static inline void addWord(
queue->push(frequency, word, length);
}
-bool UnigramDictionary::isDigraph(const int *codes, const int i, const int codesSize) const {
+// Return the replacement code point for a digraph, or 0 if none.
+int UnigramDictionary::getDigraphReplacement(const int *codes, const int i, const int codesSize,
+ const digraph_t* const digraphs, const unsigned int digraphsSize) const {
// There can't be a digraph if we don't have at least 2 characters to examine
if (i + 2 > codesSize) return false;
// Search for the first char of some digraph
int lastDigraphIndex = -1;
- const int thisChar = codes[i * MAX_PROXIMITY_CHARS];
- for (lastDigraphIndex = sizeof(GERMAN_UMLAUT_DIGRAPHS) / sizeof(GERMAN_UMLAUT_DIGRAPHS[0]) - 1;
- lastDigraphIndex >= 0; --lastDigraphIndex) {
- if (thisChar == GERMAN_UMLAUT_DIGRAPHS[lastDigraphIndex].first) break;
+ const int thisChar = codes[i];
+ for (lastDigraphIndex = digraphsSize - 1; lastDigraphIndex >= 0; --lastDigraphIndex) {
+ if (thisChar == digraphs[lastDigraphIndex].first) break;
}
// No match: return early
- if (lastDigraphIndex < 0) return false;
+ if (lastDigraphIndex < 0) return 0;
// It's an interesting digraph if the second char matches too.
- return GERMAN_UMLAUT_DIGRAPHS[lastDigraphIndex].second == codes[(i + 1) * MAX_PROXIMITY_CHARS];
+ if (digraphs[lastDigraphIndex].second == codes[i + 1]) {
+ return digraphs[lastDigraphIndex].replacement;
+ } else {
+ return 0;
+ }
}
// Mostly the same arguments as the non-recursive version, except:
@@ -94,38 +102,46 @@ void UnigramDictionary::getWordWithDigraphSuggestionsRec(ProximityInfo *proximit
int *xCoordinatesBuffer, int *yCoordinatesBuffer,
const int codesBufferSize, const int flags, const int *codesSrc,
const int codesRemain, const int currentDepth, int *codesDest, Correction *correction,
- WordsPriorityQueuePool *queuePool) {
+ WordsPriorityQueuePool *queuePool,
+ const digraph_t* const digraphs, const unsigned int digraphsSize) {
- const int startIndex = (codesDest - codesBuffer) / MAX_PROXIMITY_CHARS;
- if (currentDepth < MAX_UMLAUT_SEARCH_DEPTH) {
+ const int startIndex = codesDest - codesBuffer;
+ if (currentDepth < MAX_DIGRAPH_SEARCH_DEPTH) {
for (int i = 0; i < codesRemain; ++i) {
xCoordinatesBuffer[startIndex + i] = xcoordinates[codesBufferSize - codesRemain + i];
yCoordinatesBuffer[startIndex + i] = ycoordinates[codesBufferSize - codesRemain + i];
- if (isDigraph(codesSrc, i, codesRemain)) {
+ const int replacementCodePoint =
+ getDigraphReplacement(codesSrc, i, codesRemain, digraphs, digraphsSize);
+ if (0 != replacementCodePoint) {
// Found a digraph. We will try both spellings. eg. the word is "pruefen"
- // Copy the word up to the first char of the digraph, then continue processing
- // on the remaining part of the word, skipping the second char of the digraph.
- // In our example, copy "pru" and continue running on "fen"
+ // Copy the word up to the first char of the digraph, including proximity chars,
+ // and overwrite the primary code with the replacement code point. Then, continue
+ // processing on the remaining part of the word, skipping the second char of the
+ // digraph.
+ // In our example, copy "pru", replace "u" with the version with the diaeresis and
+ // continue running on "fen".
// Make i the index of the second char of the digraph for simplicity. Forgetting
// to do that results in an infinite recursion so take care!
++i;
memcpy(codesDest, codesSrc, i * BYTES_IN_ONE_CHAR);
+ codesDest[(i - 1) * (BYTES_IN_ONE_CHAR / sizeof(codesDest[0]))] =
+ replacementCodePoint;
getWordWithDigraphSuggestionsRec(proximityInfo, xcoordinates, ycoordinates,
codesBuffer, xCoordinatesBuffer, yCoordinatesBuffer, codesBufferSize, flags,
- codesSrc + (i + 1) * MAX_PROXIMITY_CHARS, codesRemain - i - 1,
- currentDepth + 1, codesDest + i * MAX_PROXIMITY_CHARS, correction,
- queuePool);
+ codesSrc + i + 1, codesRemain - i - 1,
+ currentDepth + 1, codesDest + i, correction,
+ queuePool, digraphs, digraphsSize);
// Copy the second char of the digraph in place, then continue processing on
// the remaining part of the word.
// In our example, after "pru" in the buffer copy the "e", and continue on "fen"
- memcpy(codesDest + i * MAX_PROXIMITY_CHARS, codesSrc + i * MAX_PROXIMITY_CHARS,
- BYTES_IN_ONE_CHAR);
+ memcpy(codesDest + i, codesSrc + i, BYTES_IN_ONE_CHAR);
getWordWithDigraphSuggestionsRec(proximityInfo, xcoordinates, ycoordinates,
codesBuffer, xCoordinatesBuffer, yCoordinatesBuffer, codesBufferSize, flags,
- codesSrc + i * MAX_PROXIMITY_CHARS, codesRemain - i, currentDepth + 1,
- codesDest + i * MAX_PROXIMITY_CHARS, correction, queuePool);
+ codesSrc + i, codesRemain - i, currentDepth + 1,
+ codesDest + i, correction, queuePool,
+ digraphs, digraphsSize);
return;
}
}
@@ -159,12 +175,23 @@ int UnigramDictionary::getSuggestions(ProximityInfo *proximityInfo,
Correction* masterCorrection = correction;
if (REQUIRES_GERMAN_UMLAUT_PROCESSING & flags)
{ // Incrementally tune the word and try all possibilities
- int codesBuffer[getCodesBufferSize(codes, codesSize, MAX_PROXIMITY_CHARS)];
+ int codesBuffer[getCodesBufferSize(codes, codesSize)];
int xCoordinatesBuffer[codesSize];
int yCoordinatesBuffer[codesSize];
getWordWithDigraphSuggestionsRec(proximityInfo, xcoordinates, ycoordinates, codesBuffer,
xCoordinatesBuffer, yCoordinatesBuffer,
- codesSize, flags, codes, codesSize, 0, codesBuffer, masterCorrection, queuePool);
+ codesSize, flags, codes, codesSize, 0, codesBuffer, masterCorrection, queuePool,
+ GERMAN_UMLAUT_DIGRAPHS,
+ sizeof(GERMAN_UMLAUT_DIGRAPHS) / sizeof(GERMAN_UMLAUT_DIGRAPHS[0]));
+ } else if (REQUIRES_FRENCH_LIGATURES_PROCESSING & flags) {
+ int codesBuffer[getCodesBufferSize(codes, codesSize)];
+ int xCoordinatesBuffer[codesSize];
+ int yCoordinatesBuffer[codesSize];
+ getWordWithDigraphSuggestionsRec(proximityInfo, xcoordinates, ycoordinates, codesBuffer,
+ xCoordinatesBuffer, yCoordinatesBuffer,
+ codesSize, flags, codes, codesSize, 0, codesBuffer, masterCorrection, queuePool,
+ FRENCH_LIGATURES_DIGRAPHS,
+ sizeof(FRENCH_LIGATURES_DIGRAPHS) / sizeof(FRENCH_LIGATURES_DIGRAPHS[0]));
} else { // Normal processing
getWordSuggestions(proximityInfo, xcoordinates, ycoordinates, codes, codesSize, flags,
masterCorrection, queuePool);
@@ -398,7 +425,7 @@ bool UnigramDictionary::getSubStringSuggestion(
if (inputWordStartPos > 0) {
const int offset = inputWordStartPos;
initSuggestions(proximityInfo, &xcoordinates[offset], &ycoordinates[offset],
- codes + offset * MAX_PROXIMITY_CHARS, inputWordLength, correction);
+ codes + offset, inputWordLength, correction);
queuePool->clearSubQueue(currentWordIndex);
getSuggestionCandidates(useFullEditDistance, inputWordLength, correction,
queuePool, false, MAX_ERRORS_FOR_TWO_WORDS, currentWordIndex);
@@ -557,10 +584,6 @@ void UnigramDictionary::getSplitMultipleWordsSuggestions(ProximityInfo *proximit
const bool hasAutoCorrectionCandidate) {
if (inputLength >= MAX_WORD_LENGTH) return;
if (DEBUG_DICT) {
- // MAX_PROXIMITY_CHARS_SIZE in ProximityInfo.java should be 16
- assert(MAX_PROXIMITY_CHARS == 16);
- }
- if (DEBUG_DICT) {
AKLOGI("--- Suggest multiple words");
}
diff --git a/native/src/unigram_dictionary.h b/native/src/unigram_dictionary.h
index 12b68d71b..86bda77cb 100644
--- a/native/src/unigram_dictionary.h
+++ b/native/src/unigram_dictionary.h
@@ -29,6 +29,8 @@ namespace latinime {
class TerminalAttributes;
class UnigramDictionary {
+ typedef struct { int first; int second; int replacement; } digraph_t;
+
public:
// Mask and flags for children address type selection.
static const int MASK_GROUP_ADDRESS_TYPE = 0xC0;
@@ -86,13 +88,15 @@ class UnigramDictionary {
void getWordSuggestions(ProximityInfo *proximityInfo, const int *xcoordinates,
const int *ycoordinates, const int *codes, const int inputLength,
const int flags, Correction *correction, WordsPriorityQueuePool *queuePool);
- bool isDigraph(const int *codes, const int i, const int codesSize) const;
+ int getDigraphReplacement(const int *codes, const int i, const int codesSize,
+ const digraph_t* const digraphs, const unsigned int digraphsSize) const;
void getWordWithDigraphSuggestionsRec(ProximityInfo *proximityInfo,
const int *xcoordinates, const int* ycoordinates, const int *codesBuffer,
int *xCoordinatesBuffer, int *yCoordinatesBuffer,
const int codesBufferSize, const int flags, const int* codesSrc,
const int codesRemain, const int currentDepth, int* codesDest, Correction *correction,
- WordsPriorityQueuePool* queuePool);
+ WordsPriorityQueuePool* queuePool, const digraph_t* const digraphs,
+ const unsigned int digraphsSize);
void initSuggestions(ProximityInfo *proximityInfo, const int *xcoordinates,
const int *ycoordinates, const int *codes, const int codesSize, Correction *correction);
void getOneWordSuggestions(ProximityInfo *proximityInfo, const int *xcoordinates,
@@ -139,13 +143,12 @@ class UnigramDictionary {
const uint8_t* const DICT_ROOT;
const int MAX_WORD_LENGTH;
const int MAX_WORDS;
- const int MAX_PROXIMITY_CHARS;
const bool IS_LATEST_DICT_VERSION;
const int TYPED_LETTER_MULTIPLIER;
const int FULL_WORD_MULTIPLIER;
const int ROOT_POS;
const unsigned int BYTES_IN_ONE_CHAR;
- const int MAX_UMLAUT_SEARCH_DEPTH;
+ const int MAX_DIGRAPH_SEARCH_DEPTH;
// Flags for special processing
// Those *must* match the flags in BinaryDictionary.Flags.ALL_FLAGS in BinaryDictionary.java
@@ -153,9 +156,11 @@ class UnigramDictionary {
// Please update both at the same time.
enum {
REQUIRES_GERMAN_UMLAUT_PROCESSING = 0x1,
- USE_FULL_EDIT_DISTANCE = 0x2
+ USE_FULL_EDIT_DISTANCE = 0x2,
+ REQUIRES_FRENCH_LIGATURES_PROCESSING = 0x4
};
- static const struct digraph_t { int first; int second; } GERMAN_UMLAUT_DIGRAPHS[];
+ static const digraph_t GERMAN_UMLAUT_DIGRAPHS[];
+ static const digraph_t FRENCH_LIGATURES_DIGRAPHS[];
// Still bundled members
unsigned short mWord[MAX_WORD_LENGTH_INTERNAL];// TODO: remove