Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Levenshtein Distance Function

Author
Message
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 5th Jun 2012 03:29 Edited at: 5th Jun 2012 03:38
I found an algorithm on the wikipedia page so thought I'd convert it to DBC.

I don't entirely understand it but it works.

It can be used in spell-checkers, search engines, text adventures, etc. to allow a degree of error.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jun 2012 13:45
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Jun 2012 19:10
Levenshtein, huh ? Is that what that's called? This came up years ago on Code Snippets:

http://forum.thegamecreators.com/?m=forum_view&t=93189&b=6

Huh, I wonder if the author came up with that themselves. Looks sneakily similar.

I did a variation at the time that counted and returned the gaps (the difference between strings) and the positions at which there were differences between strings. It seems much more efficient to me:



Enjoy your day.

Login to post a reply

Server time is: 2024-04-23 16:50:18
Your offset time is: 2024-04-23 16:50:18