77 karma · joined February 19, 2023
The prefix search uses the same suffix array as the substring search. This approach might also be useful for other search libraries that rely on suffix arrays. It can improve the search experience with minimal additional effort.
Happy to discuss the implementation details if anyone’s curious!
So, in the end, I believe it's worthwhile to try different implementations and share our subjective experiences.
As a bonus you could cache the memento in the local storage or session storage.
Distance definitions such as the Levenshtein and Damerau-Levenshtein distances provide a solid basis for discussions on accuracy. However, they are costly to compute and hence not widely adopted in fuzzy search libraries.
I started by using the known filter equation for the Levenshtein distance and computed a quality score with a leightweight formula. Then, I realized that the filter equation can be extended to the Damerau-Levenshtein distance by sorting the characters of the 3-grams.
In my tests, this implementation worked well. Please let me know how it works for you if you test it.
- have a fixed pattern, e.g. adjective.adjective.noun.
- create groups of words and put them in hierarchies. E.g. noun->animal->predator
- cover the world with a one-dimensional Hilbert curve
- Increment the noun along the curve. When all nouns are exhausted, start with the first noun again and increment the adjective in the middle, a.s.o. (analog to how incrementing a number with several digits works).
With this approach, the location purple.flying.tiger would be next to purple.flying.lion.
Semantic comments come with labels that convey their purpose, whether it's a simple remark, a question seeking an answer, a hint for future consideration, a suggestion open for discussion, an important point requiring change, or a crucial issue that must be addressed.