Newsgroups: comp.ai.fuzzy,comp.ai.nat-lang
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!news.mathworks.com!newsfeed.internetmci.com!news.sprintlink.net!in2.uu.net!psinntp!psinntp!psinntp!psinntp!bbnews!eanews1!rsvl_ns!ernie!ernie.rsvl.unisys.com!MTM4
From: MTM4@rsvl.unisys.com (Mike McCormick)
Subject: Re: Approximate string matching
Sender: news@rsvl.unisys.com (News Admin)
Message-ID: <MTM4.1220.00ECB438@rsvl.unisys.com>
Date: Fri, 6 Oct 1995 13:13:07 GMT
Lines: 32
X-Nntp-Posting-Host: mtm4
References:  <KPM.95Oct4175438@netcom22.netcom.com>
Organization: Unisys
X-Newsreader: Trumpet for Windows [Version 1.0 Rev B]
Xref: glinda.oz.cs.cmu.edu comp.ai.fuzzy:5778 comp.ai.nat-lang:3966

In article <KPM.95Oct4175438@netcom22.netcom.com> kpm@netcom.com (Keith Morgan) writes:

>I need an algorithm to approximately match character strings.
>Basically, given two input strings I want the algorithm to compute the
>maximum number of characters the two have in common while respecting
>the order of the characters in both strings. For example,

>bar <-> foobar = 3
>foo <-> bar = 0
>jean's gip joint <-> jip = 2
>moargan <-> maohren = 4

Presumably the algorithm involves lifting substrings from the shorter of the 
two input strings and searching the longer string to see if that substring is 
present.  The substring selection loop starts with the longest possible 
substring (ie. the full string itself) and iterates to progressively smaller 
substrings of {strlen()-1, strlen()-2, ..., 1} until it gets a match.  The 
length of the matched substring is the returned value.

But ... I wonder if something like soundex might do a better job for your 
application?  Depends whether you want to measure visual pattern similarity or 
oral "sounds like" similarity.


------------------------------------------------------------------
 Mike McCormick
 mtm4@rsvl.unisys.com
 m.mccormick2@genie.geis.com
------------------------------------------------------------------
 While you're out surfing the internet...
 I'm back on the beach blowing my little lifeguard whistle.
------------------------------------------------------------------
