A BK Trees (Burkhard-Keller Trees) is associated with fuzzy string searches (e.g. spell check, word recommendations). And all the BK Trees searching algorithm are the same as explained here. The aim is to return, for example, "seek" and "peek" if I search for "aeek".
Now, my question is, I'm trying to use this fuzzy string searches algorithm to search for all similar items from the given dictionary. For example, given a word "seek", I want to find all similar words, like "peek", "geek", "seat", etc within the dictionary. However I found the BK Trees searching algorithm that everyone uses is not designed for that.
Take a look my sample test result here. I found that the dictionary will be different if the feeding words order is different, thus the search result can be different as well.
What I want is, using my above sample test, given any of the four Python books, a SearchAll
function will always return the four Python books, despite the order the dictionary is built, or the order the search is done.
However, I've tried many ways but all failed (e.g., this is one of them). Now I'm throwing up my hands and asking for help. A pseudo code or generic algorithm describing would do. Thx.