Skip to content

Let search find players with accented names - #7

Open
cschmertz wants to merge 1 commit into
StephenNoh:mainfrom
cschmertz:fix-diacritic-search
Open

Let search find players with accented names#7
cschmertz wants to merge 1 commit into
StephenNoh:mainfrom
cschmertz:fix-diacritic-search

Conversation

@cschmertz

Copy link
Copy Markdown

Typing "gonzalez", "durisic", "jakucionis", "salaun", or "dadiet" into the search box currently finds nothing. Hugo González, Nikola Đurišić, Kasparas Jakučionis, Tidjane Salaün, and Pacôme Dadiet are only reachable if you type the exact accented characters, which most keyboards can't do easily.

This adds a small normalizeName helper that strips accents from both the search query and the player names before matching. It uses NFD normalization plus a special case for Đ, which doesn't decompose like the others. Searching with the accents typed out still works the same as before.

One heads up: "demin" for Egor Demin still won't match after this alone, because his name in players.js contains a stray Cyrillic character. That's fixed in #6, and with both merged he becomes searchable.

Tested in the browser against every accented name in the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant