Newsgroups: comp.ai.fuzzy,comp.ai.nat-lang
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!travelers.mail.cornell.edu!news.kei.com!news.mathworks.com!uunet!in2.uu.net!fox.almaden.ibm.com!garlic.com!news.scruz.net!cruzio!chall
From: chall@cruzio.com
Subject: Re: Approximate string matching
Reply-To: chall@cruzio.com
Organization: Cruzio Community Networking System, Santa Cruz, CA
Date: Mon, 9 Oct 1995 21:24:39 GMT
Message-ID: <DG7A54.9wx@cruzio.com>
References: <KPM.95Oct4175438@netcom22.netcom.com> <okR0KKW00iIOMO3YlA@andrew.cmu.edu>
Sender: chall@cruzio.com (Christopher Hall)
Lines: 23
Xref: glinda.oz.cs.cmu.edu comp.ai.fuzzy:5792 comp.ai.nat-lang:3977

In article <okR0KKW00iIOMO3YlA@andrew.cmu.edu>, Christopher D Manning <manning+@andrew.cmu.edu> writes:
> Keith morgan wrote:
> 
> 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.
> 
> Does anyone have have any references for decent algorithms to do this, or

It sounds like you need a best fit game algorithm.

int match(char *s, char *t) {
	int max, i;
	if ((*s == 0) || (*t == 0)) return 0;
	max = match(s+1, t+1);
	if (*s == *t) max++;
	if ((i = match(s+1, t)) > max) max = i;
	if ((i = match(s, t+1)) > max) max = i;
	return max;
}
-- 
Christopher Hall
