Filtering with diacritical marks
See original GitHub issueIt 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:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top 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 >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
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. WhatFilterListBox
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.
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.