Diacritic insensitive search #415
Unanswered
igormorgado
asked this question in
Q&A
Replies: 2 comments 3 replies
-
You can use def normalised_match(value, query):
return re.search(unidecode(query), unidecode(value), flags=re.IGNORECASE)
q.name.test(normalised_match, 'JòsÊ')
One suggestion maybe is to add a q.name.map(unidecode).search(...)
# to select where a list field has more than 5 items:
q.list.map(len) > 5 Would that be helpful? |
Beta Was this translation helpful? Give feedback.
3 replies
-
This might be solved by #445, where arbitrary unary functions can be chained to the query. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is possible to do a diacritic insensitive search using tinyDB when data stored contains UTF8 diacritics ?
A test code for better explanation. The idea is a search that handle strings "decoded" using ASCII only representations.
A way to do it, slightly outside of tinyDB, is to perform the search without the Query mechanism.
That can be generalized in the following naive (not considering registers without the
field
).Resulting in
Is possible to add such feature in
Query
mechanism?Beta Was this translation helpful? Give feedback.
All reactions