| CPAN Ratings (Gamma) String-Approx reviews | |
| Home | Search | About | Login |
RSS | Module Info | Add a review of String-Approx
3 out of 9 found this review helpful:
This module seems to work to some extent, but it has a fair share of problems. It's written using a C extension, and it doesn't work with Perl's utf8, so lengths from "aindex" and "aslice" come out in bytes even when it's fed a correctly encoded UTF-8 string.
The documentation is fairly lousy, and does not bother to carefully describe what it means by "approximate match". It was only by looking at the test code that I could understand what it meant
The calling conventions for these routines are also counterintuitive The routine "aslice" refuses to return a list in list context. Instead, if it's called in list context, it returns a reference to an array, and if it's called in scalar context, it returns a list, which is then converted to a number because of the scalar context. I don't know what the author could possibly have been thinking when he designed that.
*Be warned* also about version 2.7 of this module. cpanratings doesn't seem to allow me to add different comments for two versions of the same module, so I'll put comments here. First, the code is dangerous - it calls "die" if there is an input error instead of just returning to the calling routine. Also the source code is almost unreadable, with variable names which are one or two letters long, and worst of all the methodology is insane - it creates regular expression of length O(n!), where n is length of the original string we're trying to match, using a list of every possible combination of "nearly matching" strings. Note that this insanity is from an author who wrote a book on "Mastering Algorithms with Perl". It works with UTF-8, because it only uses regular expressions, but it's an utter mess. I can't recommend either version 3.26 or version 2.7.
Three stars for version 3.26: ★☆★☆★
One star for version 2.7: ★☆☆☆☆
BKB - 2008-08-08 04:16:20
Was this review helpful to you?
Yes
No
I don't see anything wrong with a program dieing on an error. It's just as easy to trap that with eval and respond as it is to check a return code. And if anything, it's *safer* to die if there's an error than to continue as if nothing's wrong.
Robert Rothenberg - 2008-06-12 15:15:18
Was this review helpful to you?
Yes
No
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|