aarondandy / WeCantSpell.Hunspell

A port of Hunspell v1 for .NET and .NET Standard
https://www.nuget.org/packages/WeCantSpell.Hunspell/
Other
126 stars 19 forks source link

Suggest algorithm optimization: Levenshtein distance #65

Closed aarondandy closed 2 years ago

aarondandy commented 2 years ago

Because this is a port of the original library, I don't want to get too creative with the algorithms. For suggest, especially, these brute forcing nested loops can really hurt as the x64 compilers don't put the same amount of up-front effort into optimizations. Maybe something like Levenshtein distance, which I don't even know if I spelled correctly, could be of use without changing the results?

If something can be improved there, the benefits could impact #33, #40, and #43 .

Learning resources from https://github.com/Turnerj/Quickenshtein#learning-resources

aarondandy commented 2 years ago

I'm not really sure if this can help with the ngram substring performance but will re-open if I learn more.