metadata-research / yamz

A crowd-sourced metadata dictionary
MIT License
9 stars 4 forks source link

Discussion: Rationalize Search Term Normalization #106

Open sm4522 opened 1 year ago

sm4522 commented 1 year ago

A space at the end of a single term causes an error page to appear when using the search bar. "ablation " is a case.

jkunze commented 1 year ago

Good spotting. I found two more cases. An error occurs when a search term is entered with (a) space after the term "foo ", (b) space before the term " foo", and (c) two or more spaces between two terms "foo bar" (the markdown may render my 3 spaces as 1 space).

cr625 commented 1 year ago

Ok, stripped the whitespace from the end but is anticipating three spaces incorrectly entered in the search term necessary? If so we should use something like https://pypi.org/project/textnorm/ or some combination of libraries instead of trying to build things from scratch. In the markdown, we use bleachify and markdown doesn't render extra spaces by default. One solution is to add &\nbsp; but right now we are not allowing this. The list of allowed tokens is in term/models

EMiller34 commented 1 year ago

Initial Bug: Search issue with space at the end of a term has been resolved.
Discussion needed on how to normalize searching.