Open SunboX opened 14 years ago
One more: approximated string matching
Thats very interesting. Maybe a demo showing how to do it would be cool, not something builtin. I'll try it out. Thanks!
I'm interested on your application, can you explain it?
Yes, i´m looking for an autocompletion, that suggests the following:
I´m typing: Mac Donalds Suggests:
McDonald´s Mac Doctors Mac Fastfood
A normal autocompletion would only show the last two suggests. But that´s wrong in this case. The order of the suggested words should be the levenshtein index for similarity. Lower index on top.
In my case the autocompletion list would be prefilled with location names around a persons location. And if that person types the name of a location, it should try to get the name the person is looking for.
This is what i want to get (not tested yet!):
Is it possible to modify filter behavior, that they return integers instead of booleans? Like this:
http://jsfiddle.net/SunboX/Z69jS/
greetings, André
So we could sort the filtered items by best fitting. ;o)
cool stuff, im thinking about this to make it in a way that can be very generic, that you could define any kind of sorting on your options...
Hey man you can use the similarity functionality without needing to change anything... look at this and tell what you think: http://jsfiddle.net/7cUgF/1/ I've reduced a little the levenshtein function.
Could you implement a option to get autocompletion by similarity? Like this:
http://phpjs.org/functions/levenshtein:463
Would be really cool! Maybe a combination from current algorithm (first chars matching) and the levenshtein algorithm is also possible.