You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the players.get_players() and players.find_players_by_(full/last/first)name functions, the list contains accented player names (Luka Dončić, Nikola Jokić, etc), and in order to correctly finding players by name, the input parameters must have the accents as well find_players_by_full_name('Jokic') returns empty). Since regex notation doesn't natively support accent removal, some suggestions to improve usability:
a) could players.find_players_by(full/last/first)name functions incorporate accent neutral searching (input string unaccented matching to accented player name)? Adding a function such as the below:
"""
def strip_accents(inputstr: str) -> str:
normalizedstr = unicodedata.normalize('NFD', inputstr)
stripped = ''
return stripped.join(charx for charx in normalizedstr if unicodedata.category(charx) != 'Mn')
"""
or
b) could an additional entry be added to the static player list with the unaccented player name (if applicable)? then the players.find_players_by(full/last/first)_name functions could attempt to match to both the accented and unaccented versions of the names.
The text was updated successfully, but these errors were encountered:
I'd be in favor of option A, unicode normalized seach. This should be the most transparent way for the users so that anyone using accents for search would be oblivious to the modification.
If you're up for submitting a PR with a unit test, I'll review, merge, and get an update out.
In the players.get_players() and players.find_players_by_(full/last/first)name functions, the list contains accented player names (Luka Dončić, Nikola Jokić, etc), and in order to correctly finding players by name, the input parameters must have the accents as well find_players_by_full_name('Jokic') returns empty). Since regex notation doesn't natively support accent removal, some suggestions to improve usability:
a) could players.find_players_by(full/last/first)name functions incorporate accent neutral searching (input string unaccented matching to accented player name)? Adding a function such as the below:
"""
def strip_accents(inputstr: str) -> str:
normalizedstr = unicodedata.normalize('NFD', inputstr)
stripped = ''
return stripped.join(charx for charx in normalizedstr if unicodedata.category(charx) != 'Mn')
"""
or
b) could an additional entry be added to the static player list with the unaccented player name (if applicable)? then the players.find_players_by(full/last/first)_name functions could attempt to match to both the accented and unaccented versions of the names.
The text was updated successfully, but these errors were encountered: