3 ms·
Sorting should probably have its own list. "Ordering of words follows simply from ordering on the letters in the alphabet" - nope, Spanish "ll" is not in the a
by praptak 2y ago
Sorting should probably have its own list.
"Ordering of words follows simply from ordering on the letters in the alphabet" - nope, Spanish "ll" is not in the alphabet and is sorted like a single special letter.
"It's always lexicographical left to right or at least lexicographical in a single, consistent direction?" - nope, accents in French (è,é) are compared right-to-left.
- josemfb 2y agoNative speaker of Spanish here (from Spain, living in Chile). “Ll” is sorted as two independent letters, same as “Ch”. Until 2010, the Real Academia Española (along the other Academias, of the various countries that speak spanish), considered both “Ll” and “Ch” distinct letters of the alphabet, and they were sorted accordingly [0][1][2]. [0] https://www.rae.es/dpd/abecedario https://www.rae.es/dpd/abecedario (in Spanish) [1] https://www.rae.es/dpd/ll https://www.rae.es/dpd/ll (in Spanish) [2] https://www.rae.es/dpd/ch https://www.rae.es/dpd/ch (in Spanish)
- praptak 2y agoYeah thanks for the correction, I don't know Spanish, I just remembered this example from a long list of international sorting oddities.
- 1-more 2y agoI was JUST making a demo showing that sorting is different per locale (using String.prototype.localeCompare() in JS) and I was SHOCKED that Spanish no longer orders things "langosta, lugar, llama" but rather "langosta, llama, lugar." I had to redo things to do German vs Swedish sorting (In German, ä comes between a and b, whereas in Swedish it comes after z). So here I was thinking that the browsers were sorting naively, but in fact they are more with the times than I am. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...