theriex / rh

PastKey.org source and issues
https://pastkey.org
1 stars 0 forks source link

Spelling synonyms conversion for search #8

Closed theriex closed 5 years ago

theriex commented 6 years ago

To facilitate search, Hawai'i should also match "Hawaii" or "Hawaiian". Accent marks on letters, particularly common Spanish marks, should similarly translate. Extend search to handle these algorithmic equivalence values for at least common known cases. Preferably in a way that can be easily modified if new equivalence values are discovered, or that happens automatically if there is a commonly accepted mapping.

theriex commented 5 years ago

Really need Chávez and Chavez to be equivalent. Not to mention César and Cesar. Thinking that these could be handled as regex search equivalents based on the entered search text.

theriex commented 5 years ago

Added a makeMatchFromSearch input string conversion that first replaces multi-character patterns in the search string (e.g. "i.?i", allowing for either Hawaii or Hawai'i to match), then single character replacements (e.g. "[e,é]", allowing either Cesar or César to match). Huge improvement in matching. Match speed is not noticeably slower.