12-07-2010 05:12 AM
Do you know any functions, packages, addons... for calculating string similarity? (such as Levenshtein distance, etc.)
12-07-2010 05:29 AM
I think you have to build these functions on your own..Using string functions available.
See this example of "Levenshtein distance"....
12-07-2010 05:33 AM
12-07-2010 07:30 AM
LAVA version works. gak's VI sometimes doesn't. Compared with PHP's Levenshtein function
12-07-2010 09:39 PM
May be, I just gave an example as in how you can use string functions available in labview to fulfill your purpose.![]()
10-11-2026 10:31 PM
Thanks everyone for sharing the LabVIEW implementations, especially Gak and Felix.
Since the original poster mentioned that one VI sometimes gives incorrect results compared with PHP, I'd suggest testing a few simple cases:
"kitten" vs. "sitting" → 3
"abc" vs. "abc" → 0
"abc" vs. "" → 3
"ab" vs. "ba" → 2 (standard Levenshtein)
If the results differ, I'd check the initialization of the first row and column in the distance matrix, then verify that the previous diagonal value is preserved when updating cells.
These are common places where a dynamic programming implementation can go wrong.
This reference on https://www.levenshtein.net/levenshtein-implementations explains the relevant details.
For transparency, I contribute to the linked reference.
Thanks again for the helpful discussion!