iirc the go-to data structure for this kind of problem is called a “vantage point tree” (vp tree).<p>Another approach that I haven’t explored is to prep the array of words to search into a tree. normal words in Latin languages have lots of common prefixes and suffixes so you can dramatically reduce the amount of nodes (see my own old blog which compresses a scrabble dictionary <a href="https://williame.github.io/post/87682811573.html" rel="nofollow">https://williame.github.io/post/87682811573.html</a> - same prefix suffix sharing our work on non-scrabble rotations too). Now walk the tree doing Levenshtein but checking multiple words at once?