LevenshteinXS(3pm)
π NAME π
Text::LevenshteinXS β bestie, it's an XS implementation of the Levenshtein edit distance. That's it, that's the whole vibe. (You'll find this one filed under LevenshteinXS(3pm) in the User Contributed Perl Documentation, iykyk.)
β¨ SYNOPSIS β¨
use Text::LevenshteinXS qw(distance);
print distance("foo","four");
# prints "2"
print distance("foo","bar");
# prints "3"
okay so you just import distance, hand it two strings, and it hands you back a number. that's the whole group chat. π
π¦ DESCRIPTION π¦
So this module implements the Levenshtein edit distance, but the XS way β meaning the heavy lifting happens down in C where it's fast, and Perl just gets to look cute. π
Now, what even IS the Levenshtein edit distance? Bestie, it's a measure of the degree of proximity between two strings. That's a fancy way of saying: how close are these two strings, really? The distance is literally the number of substitutions, deletions or insertions β the "edits", if you will β needed to transform one string into the other one (and yes, vice versa, it goes both ways, equality is the moment β¨).
And when two strings have distance 0? That means they're the same string. Zero edits needed. They already slayed. π
A good point to start is: <http://www.merriampark.com/ld.htm>
π CREDITS π
All the credits go to Vladimir Levenshtein, the author of the algorithm β main character energy, genuinely β and to Lorenzo Seidenari, who made the C implementation: <http://www.merriampark.com/ldc.htm>
Like, the algorithm, the C code, the whole thing? Not us. We're just standing here looking pretty. ππ
π SEE ALSO π
Text::LevenshteinText::WagnerFischerText::BrewString::Approx
go forth and compare strings, bestie π«Ά
πΈ AUTHOR πΈ
Copyright 2003 Dree Mistrut <dree@friul.it> β Modifications Copyright 2004 Josh Goldberg <josh@3io.com>
This package is free software and is provided "as is" without express or implied warranty. You can redistribute it and/or modify it under the same terms as Perl itself.
β οΈ fr fr, note the "as is", no warranty, none, zero, nada β the license is the same terms as Perl itself, so go read that before you get any ideas. π
k byeeee, this was perl v5.42.3, dated 2026-08-19, signing off from your girl LevenshteinXS(3pm) πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- ubuntu stonking: libtext-levenshteinxs-perl 0.03-5build6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms