[futurebasic] Re: [FB] Metaphone

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2001 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Tue, 04 Sep 2001 16:48:52 +0200
Alain Pastor wrote:
> 
OOPS! I forgot this about Metaphone:

Ken,

You have not described the bug exactly. Not knowing what the program
should produce, I have just found this:
 

> 
> LOCAL FN lookupTransform$( inputWordStr AS STR255, prechar AS STR255,
> postchar AS STR255, skiplen AS INTEGER )
>
> 
> FOR y = 0 To maxidx

 <snip>
 
> NEXT maxidx  '<= should be NEXT y
> 
> END FN = outStr
> 
> LOCAL FN calcMetaphone$( inputWordStr AS STR255 )

> inputWordStr = UCASE$( FN Trim$( inputWordStr ) )
> 
> // Initial Letter Exceptions
> 
> workingStr = "," + LEFT$( inputWordStr, 2 ) + ","
> 
> SELECT CASE
> 
> CASE INSTR( 1, ",kn,gn,pn,ae,wr,", workingStr )

should probably be: CASE INSTR( 1, ",KN,GN,PN,AE,WR,", workingStr )

 
> END FN = finalStr
> 
> DIM myStr AS STR255
> 
> myStr = "Smith"
> 
> PRINT FN calcMetaphone$( myStr )
> 
> '------ END CODE -------

-- 

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------