diff options
author | 2012-03-23 02:44:35 -0700 | |
---|---|---|
committer | 2012-03-23 02:44:35 -0700 | |
commit | 85594cb7df732bed307325b31cd298f1c5fc598f (patch) | |
tree | 01b61a2ba188e7ed3ddc58a75f634cc38fd2eb01 /native/src | |
parent | 3d3ee645cc2932af8978c18c1f06a1fdbc510319 (diff) | |
parent | cc78d03a62412e647d4c1373e88a4a2637244ed5 (diff) | |
download | latinime-85594cb7df732bed307325b31cd298f1c5fc598f.tar.gz latinime-85594cb7df732bed307325b31cd298f1c5fc598f.tar.xz latinime-85594cb7df732bed307325b31cd298f1c5fc598f.zip |
Merge "Add processing for French ligatures."
Diffstat (limited to 'native/src')
-rw-r--r-- | native/src/unigram_dictionary.cpp | 13 | ||||
-rw-r--r-- | native/src/unigram_dictionary.h | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp index 563541dce..304a4df38 100644 --- a/native/src/unigram_dictionary.cpp +++ b/native/src/unigram_dictionary.cpp @@ -34,6 +34,10 @@ const UnigramDictionary::digraph_t UnigramDictionary::GERMAN_UMLAUT_DIGRAPHS[] = { '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, @@ -181,6 +185,15 @@ int UnigramDictionary::getSuggestions(ProximityInfo *proximityInfo, 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, MAX_PROXIMITY_CHARS)]; + 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); diff --git a/native/src/unigram_dictionary.h b/native/src/unigram_dictionary.h index b85913ffb..f9ee5089d 100644 --- a/native/src/unigram_dictionary.h +++ b/native/src/unigram_dictionary.h @@ -157,9 +157,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 digraph_t GERMAN_UMLAUT_DIGRAPHS[]; + static const digraph_t FRENCH_LIGATURES_DIGRAPHS[]; // Still bundled members unsigned short mWord[MAX_WORD_LENGTH_INTERNAL];// TODO: remove |