Check out our General Code Repository Files. Also, before posting here, check to see if your post doesn't fit into another subforum by category.
Tags |
(This content has not been tagged yet)
|
![]() |
Aug 20 2008, 09:49 PM
Post
#1
|
|||
|
One hit wonder! Member Posts: 1 Joined: 20-August 08 From: Napa, CA Member No.: 12325 Using LabVIEW Since:1991 LV:7.1 ,8.0 ,.
|
File Name: Strings Levenshtein Distance File Submitter: NimbleThink File Submitted: 20 Aug 2008 File Category: General 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) Click here to download this file -------------------- Any fool can take data, it's taking good data that counts.
www.NimbleThink.com
|
||
|
|
|||
| Ad |
Aug 20 2008, 09:49 PM
Post
#
|
||
|
|
|
||
|
|
|||
![]() ![]() |
| Time is now: 8th January 2009 - 12:30 AM |