News for hackers. Stuff that matters.
Re:Approximate Regex Matching in Python by rplnt on Friday January 20, 2012 @11:41AM (#3490048)
Another approximate matching library is FuzzyWuzzy[1]. It has some handy functions and seems easier to use. Although might not be as powerful as this.

1. https://github.com/seatgeek/fuzzywuzzy

Re:Approximate Regex Matching in Python by schwa on Friday January 20, 2012 @12:39PM (#3490298)
Bonus points for the racist project name too.
Re:Approximate Regex Matching in Python by coderdude on Friday January 20, 2012 @12:43PM (#3490315)
If you're English, which they're not.
Re:Approximate Regex Matching in Python by rcfox on Friday January 20, 2012 @04:22PM (#3491271)
English is my first language, and I have no idea of what he's talking about.
Re:Approximate Regex Matching in Python by burgerbrain on Friday January 20, 2012 @06:52PM (#3491853)
Re:Approximate Regex Matching in Python by Wilduck on Friday January 20, 2012 @11:55AM (#3490108)
This is really cool, but I'm curious what the performance implications are when doing fuzzy matching? I noticed that the list of types of errors did not include transposition. I wonder if the reason for this comes down to performance/technical reasons.
Re:Approximate Regex Matching in Python by coderdude on Friday January 20, 2012 @12:07PM (#3490160)
The author wrote more about the library here: http://laurikari.net/tre/about/

He talks about the time complexity ("O(M^2N), where M is the length of the regular expression and N is the length of the text"), and he talks more about it under "Predictable matching speed." It doesn't look like he talks about how the fuzziness feature affects that but I could have missed it.

Re:Approximate Regex Matching in Python by Wilduck on Friday January 20, 2012 @12:45PM (#3490333)
Wow, I'm glad you linked to that article, otherwise I would have thought the complexity was O(M^(2N)) instead of O((M^2)N). Although, the fact that I almost mistook that complexity means I should probably spend some time learning about how regular expressions are implemented. Thanks for the link.
Re:Approximate Regex Matching in Python by burgerbrain on Friday January 20, 2012 @06:50PM (#3491843)
O(M^(2N)) would get absolutely ludicrous pretty damn quick.
Re:Approximate Regex Matching in Python by metafunctor on Friday January 20, 2012 @03:23PM (#3491061)
Author of the library here.

The fuzziness doesn't affect the worst case time complexity, but it does make the "working set" of possible states larger and slows down matching somewhat. But search time is still linear to the length of the text.

Re:Approximate Regex Matching in Python by coderdude on Friday January 20, 2012 @03:29PM (#3491073)
Thanks for the information and for writing this lib. It looks like it's the only regex library out there with fuzzy matching, and it's got Python bindings. Could not have asked for more!
Re:Approximate Regex Matching in Python by metafunctor on Friday January 20, 2012 @04:10PM (#3491238)
Adding transposition I've thought about, and received a number of requests for, but never got around to doing it. The reason isn't performance, but doing a change like this would get quite involved with the guts of the library, and I simply don't have the time...