question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use ICU to sort words correctly

See original GitHub issue

IUC 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lasconiccommented, Nov 6, 2020

Ok 😃 It makes sense to remove it.

0reactions
BoboTiGcommented, Nov 6, 2020

I do not recall why I added it at first 🤔

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found