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.

Filtering with diacritical marks

See original GitHub issue

It would be really useful to have an option on the components such as FilterListBox to ignore diacritical marks. That would allow for a search of para (for example) to return both paralelogramo and parábola in Spanish.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JanMiksovskycommented, May 23, 2020

Progress report: I’ll be checking in a fix for this.

Like most international issues, this turns out to be more complicated than it first looks. The Intl.Collator object looks very promising for this situation — but unfortunately appears only used in comparing strings. What FilterListBox does to search strings.

I did find a helpful string normalization snippet that removes accents which seems to work. However, it’s not strictly speaking correct. In some languages, accents matter. Example: ä and a have the same base letter in German, but in Swedish those are separate base letters. A Swedish user may therefore be disappointed/annoyed if those letters are treated the same for filtering purposes.

That said, removing accents seems more helpful in most cases, so I’ve gone ahead with that as a basis for a fix. I’ve also exposed a method on the component that a dev can override to customize the matching behavior for specific situations/locales.

0reactions
klobetimecommented, May 26, 2020

Great – thanks! I missed your last reply for some reason; I’d have been interested in helping but really didn’t have the time to be honest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Diacritics-neutralise - DataTables
When filtering a table with accented characters (letters with diacritical marks) it can be frustrating to have an input such as Zurich not...
Read more >
Searching and sorting text with diacritical marks in JavaScript
First, we need to “decompose” the string so that any characters with diacritical marks are represented by their two-byte surrogate pair. This is...
Read more >
How can I filter a MatTable with accents/diacritics?
We'll use this in our new filterPredicate . We remove accents/diacritics from both the values in the table as well as the filter...
Read more >
Character Filtering - Query Understanding
Unicode normalization transforms strings into a standard character encoding, but it leaves accents (more technically, diacritics) in place. For ...
Read more >
Article linking filter for diacritical marks is always on. | World Anvil
When attempting to search for an article, and in particular when attempting to link an existing one to a WIP article via the...
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