Strings Levenshtein Distance
Before you submit code to the Code Repository, please make sure you have read the following:
Introduction - Submission Guidelines - Submission Procedure - (post questions here)
|
Strings Levenshtein Distance
|
|
|||||||||||||||||||||||
|
|
||||||||||||||||||||||
This VI computes the Levenshtein distance between two strings. It is based on the pseudocode found in Wikipedia. Why is this useful? Let's say you have some code which is maintaining a list of items: test names, product names, model variants, user names, etc. Let's say a user has to enter a new or existing item. What if they make a typographical error and enter something which is close to, but not matching, an existing item in the list? From many years of data analysis I know that filtering out and correcting these "almost matches" is a major chore. By computing the Levenshtein distance between a user entered item and the already existing items you can test to see if the entered item might be a typo of an already existing item. If the user entered string is close to an existing one, then display a dialog box asking the user if they want to use the already existing item, re-enter the new item, or really use the item entered. The algorithm as supplied is case sensitive, you can furnish external code to capitalize the strings to be compared. See another VI QUOTE String Compare to Array of Strings.vi which implements the comparison of a test string to an array of strings and finds the closest string.Some examples of the Levenshtein distance: string 1 string 2 distance leif kleif 1 Honda Hodna 2 Honda hodna 3 sitting kitten 3 (Wikipedia example) |
|||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Approved by mballa on Aug 29 2008, 12:13 AM | |||||||||||||||||||||||
Saved Versions
| Name | Filename | Updated | Operations |
|---|---|---|---|
| Strings Levenshtein Distance | Strings_Levenshtein_Distance.zip | 20th August 2008 - 09:49 PM |
|
Code Repository Statistics
| Last ten submissions accepted · Downloads system statistics | |
| 3 user(s) active in the past 15 minutes | |
![]() |
2 guests, 1 members, 0 anonymous members |
| Code Repository Statistics | |
![]() |
We have a total of 74 files in 13 categories A total of 40 unique authors have submitted to our site There have been 28746 logged downloads to date The latest file submitted was Skype SDK by Antoine Châlons (submitted Dec 24 2008, 09:44 AM) |
| Time is now: 6th January 2009 - 07:47 PM |