Ambiguous decomposition sequences now decompose to first ranked decomposition

(resolves #18)
This commit is contained in:
2016-04-22 11:30:42 +02:00
parent 5df7ca886b
commit 8c51f9c2a6
6 changed files with 24 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ namespace ZRCola {
///
struct translation {
wchar_t chr; ///< Composed character
unsigned __int16 rank; ///< Decomposition rank
unsigned __int16 str_len; ///< \c str length (in characters)
wchar_t str[]; ///< Decomposed string
@@ -183,6 +184,9 @@ namespace ZRCola {
if (a.chr < b.chr) return -1;
else if (a.chr > b.chr) return +1;
if (a.rank < b.rank) return -1;
else if (a.rank > b.rank) return +1;
int r = translation::CompareString(a.str, a.str_len, b.str, b.str_len);
if (r != 0) return r;