Repository navigation
#1235: Match Excel Thai text ordering - #1241
justinjohn0306 wants to merge 1 commit into
Conversation
…reak ties, ß/æ/œ tie with ss/ae/oe, Thai leading vowels first Thai tone marks, Hebrew points, Arabic harakat and the Indic nukta/anusvara are not alphabetic, so the first sort level counted them as punctuation and put ข้าว before ขาว. They are now ignored at the first level (DUCET's primary-ignorable Mn characters of those scripts); viramas count as letters. ß, æ, œ and ij equal their two letters at every level, so descending sorts keep `ss, ß` in input order as Excel does. A word starting with a Thai leading vowel sorts before the Thai consonants (Excel, storytold#1235), the rule storytold#1241 adds to compare_text, which SORT no longer uses for two texts.
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: Thai text ordering matches Excel (#1235). The case-insensitive text order in the core is extended so that Thai leading vowels are ordered by the consonant that follows them, with a test that "เกม" < "กา" is TRUE. Excel's comparison uses the operating system's locale collation, which for Thai ignores the leading vowel at the first level, so the idea is right; whether each expected value in the test is what Excel gives is something I cannot check, and the contributor should show Excel's result for each assertion. A locale-specific special case inside the value comparison is also the third approach to collation in the suite (gridcraft#2036, #2409 and deckcraft#1052 use ICU4X or UCD data), and they should be reconciled. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
Fixes #1235.
Thai leading vowels (เ แ โ ใ ไ) now sort before Thai consonants in the shared text comparator. This brings
SORTand formula string comparisons such as="เกม"<"กา"in line with Excel's reported ordering while keeping one consistent total order for mixed scripts.Regression tests cover the issue's Thai SORT sample, the comparison operator, and mixed Latin/Thai ordering.
Verified with
cargo xtask ci(fmt, clippy, workspace tests, assets, layers, WASM, and parity all pass).