I want to build a search with basic typo tolerance. There are quite a few string similarity algorithms (and implementations for almost all languages I guess).
However, humans tend to make some typos more frequently than others. E.g
- mixing up the order of letters when typing, e.g
tpying
instead oftyping
- hitting the key next to the intended one, e.g.
slright
instead ofalright
becauses
anda
are next to each other on most keyboard layouts - mixing up letters with similar sounds associated to them, e.g.
there
instead oftheir
I think, a good typo tolerance algorithm should take that into account. E.g. the pair alright
and slright
should get a higher similarity than alright
and mlright
. As far as I known, no string similarity algorithms does something like this.
Are there free algorithms (and implementations in TypeScript) which do?
(Unfortunately, just gathering masses of data of what my users actually type is not an option for me.)