String-Approx reviews

cpanratings
 

RSS | Module Info | Add a review of String-Approx

String-Approx (3.26) ****

Have used this module for years; it has always worked well for me in providing basic approximate matching capabilities.

The other review seems a bit harsh. The module gets the job done, is maintained, has decent documentation and a test suite. The guts may not be pristine and not every single function may be UTF-8 clean, but I've seen a lot worse.

Plus it isn't like there are any alternatives for approximate matching modules, so go ahead and use it, it won't hurt.

Ivan Kohler - 2010-03-21T22:25:05 (permalink)

1 out of 1 found this review helpful. Was this review helpful to you?  Yes No

String-Approx (3.26) **

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: ★☆☆☆☆

Ben Bullock - 2008-08-08T04:16:20 (permalink)

5 out of 13 found this review helpful. Was this review helpful to you?  Yes No

String-Approx (3.26)

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-12T15:15:18 (permalink)

3 out of 5 found this review helpful. Was this review helpful to you?  Yes No