Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fuzzy match

7 views
Skip to first unread message

michael.f...@colostate.edu

unread,
May 23, 2005, 6:09:51 PM5/23/05
to
Hi all,

Does anyone now if there is a way to do a fuzzy string compare in c#?
For example, comparing 'cat' to 'cats' would return something like a
90% match ratio. I was told that this type of fuctionality exists in
Perl but I can't find anything about it in c#.

Thanks
Mike

John Timney (ASP.NET MVP)

unread,
May 23, 2005, 6:26:51 PM5/23/05
to
use a regular expression

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

<michael.f...@colostate.edu> wrote in message
news:1116886191.8...@g44g2000cwa.googlegroups.com...

seani

unread,
May 23, 2005, 6:29:45 PM5/23/05
to

Don't waste your time investigating regular expressions as suggested; a
regexp either matches or does not match, there is no fuzziness about it.
Regexps *may* help you in implementing a fuzzy matching algorithm in some
small way.

I'd suggest that you may want to investigate ways to implement the
Levenshtein distance if you are comparing multiple terms. The following
link has a nice explanation and source code in VB, Java and C

http://www.merriampark.com/ld.htm

and here's the c# version for the truly lazy :)

http://www.merriampark.com/ldcsharp.htm

michael.f...@colostate.edu

unread,
May 24, 2005, 1:35:39 PM5/24/05
to


Thanks
-Mike

0 new messages