diff options
author | 2011-12-26 19:51:11 -0800 | |
---|---|---|
committer | 2011-12-26 19:51:11 -0800 | |
commit | f2a12e5ad35ff59cd58c6422560218e21c27ef76 (patch) | |
tree | 416792df03888c259a4fa0945603baa0d97eeb7f | |
parent | 841ccf4a5a0cb0f228b21817386ee2714ccb0000 (diff) | |
parent | e85b5bed57f4086f45bce53f27f959277afe3f0c (diff) | |
download | latinime-f2a12e5ad35ff59cd58c6422560218e21c27ef76.tar.gz latinime-f2a12e5ad35ff59cd58c6422560218e21c27ef76.tar.xz latinime-f2a12e5ad35ff59cd58c6422560218e21c27ef76.zip |
am e85b5bed: Merge "Skip shortcut targets if any. (A1)"
* commit 'e85b5bed57f4086f45bce53f27f959277afe3f0c':
Skip shortcut targets if any. (A1)
-rw-r--r-- | native/src/binary_format.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/native/src/binary_format.h b/native/src/binary_format.h index 6f65088db..cbaccb295 100644 --- a/native/src/binary_format.h +++ b/native/src/binary_format.h @@ -145,15 +145,15 @@ inline int BinaryFormat::skipFrequency(const uint8_t flags, const int pos) { inline int BinaryFormat::skipAllAttributes(const uint8_t* const dict, const uint8_t flags, const int pos) { - // This function skips all attributes. The format makes provision for future extension - // with other attributes (notably shortcuts) but for the time being, bigrams are the - // only attributes that may be found in a character group, so we only look at bigrams - // in this version. + // This function skips all attributes: shortcuts and bigrams. + int newPos = pos; + if (UnigramDictionary::FLAG_HAS_SHORTCUT_TARGETS & flags) { + newPos = skipAttributes(dict, newPos); + } if (UnigramDictionary::FLAG_HAS_BIGRAMS & flags) { - return skipAttributes(dict, pos); - } else { - return pos; + newPos = skipAttributes(dict, newPos); } + return newPos; } inline int BinaryFormat::skipChildrenPosAndAttributes(const uint8_t* const dict, |