Use ICU to sort words correctly
See original GitHub issueIUC should be used to correctly sort words according to the target locale:
from icu import Collator, Locale
collator = Collator.createInstance(Locale.getFrance())
# or collator = Collator.createInstance(Locale("fr_FR.UTF-8"))
words = sorted(words, key=collator.getSortKey)
For more details, go see the Miroslav Šedivý - Your Name Is Invalid! conference from the EuroPython 2020.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
FieldWorks Sorting With ICU Rules - SIL Language Technology
Martin Hosken wrote an excellent tutorial on using ICU collation ... By default, ICU would sort words in this order (nab, Nab, NAB,...
Read more >Customization | ICU Documentation
ICU uses the CLDR root collation order as a default starting point for ordering. ... All the words sorted after “a” and “A”...
Read more >Does ICU handle the collation of a list of strings of varying ...
There is no sensible way to do this well. There is no universal sort for all languages, even within the same alphabet.
Read more >ICU sort sequence - Db2 for i SQL - IBM
An ICU sort sequence table named en_us (United States locale) can sort data differently than another ICU table named fr_FR (French locale) for...
Read more >ICU Collation Keyword Field | Elasticsearch Plugins and ...
Collations are used for sorting documents in a language-specific word order. ... Defaults to using DUCET collation, which is a best-effort attempt at ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok 😃 It makes sense to remove it.
I do not recall why I added it at first 🤔