Re: need help convert c code

2009-07-17 Thread bearophile
Lars T. Kyllingstad: > Fun fact: There is already a Levenshtein distance algorithm in Phobos > for D2: > http://www.digitalmars.com/d/2.0/phobos/std_algorithm#levenshteinDistance For more than a year there's a Levenshtein distance for D1 in my dlibs too, and it's quite faster than the one in Pho

Re: need help convert c code

2009-07-17 Thread Lars T. Kyllingstad
D. Reeds wrote: Lars T. Kyllingstad Wrote: Fun fact: There is already a Levenshtein distance algorithm in Phobos for D2: http://www.digitalmars.com/d/2.0/phobos/std_algorithm#levenshteinDistance I know you said you use D1+Tango, I just thought I should mention it. The source code is available

Re: need help convert c code

2009-07-17 Thread D. Reeds
Lars T. Kyllingstad Wrote: > Fun fact: There is already a Levenshtein distance algorithm in Phobos > for D2: > http://www.digitalmars.com/d/2.0/phobos/std_algorithm#levenshteinDistance > > I know you said you use D1+Tango, I just thought I should mention it. > The source code is available, if yo

Re: need help convert c code

2009-07-17 Thread Lars T. Kyllingstad
D. Reeds wrote: Robert Fraser Wrote: D. Reeds wrote: can anybody help me translate this c code into d, im using D1+tango combo. i'm new to D and got stucked on multi-dimension array part. int levenshtein_distance(char *s,char*t) //Compute levenshtein distance between s and t { //Step 1 i

Re: need help convert c code

2009-07-16 Thread D. Reeds
Robert Fraser Wrote: > D. Reeds wrote: > > can anybody help me translate this c code into d, im using D1+tango combo. > > i'm new to D and got stucked on multi-dimension array part. > > > > int levenshtein_distance(char *s,char*t) > > //Compute levenshtein distance between s and t > > { > > /

Re: need help convert c code

2009-07-16 Thread D. Reeds
Robert Fraser Wrote: > D. Reeds wrote: > > can anybody help me translate this c code into d, im using D1+tango combo. > > i'm new to D and got stucked on multi-dimension array part. > > > > int levenshtein_distance(char *s,char*t) > > //Compute levenshtein distance between s and t > > { > > /

Re: need help convert c code

2009-07-16 Thread Robert Fraser
D. Reeds wrote: can anybody help me translate this c code into d, im using D1+tango combo. i'm new to D and got stucked on multi-dimension array part. int levenshtein_distance(char *s,char*t) //Compute levenshtein distance between s and t { //Step 1 int k,i,j,n,m,cost,*d,distance; n=strle

need help convert c code

2009-07-16 Thread D. Reeds
can anybody help me translate this c code into d, im using D1+tango combo. i'm new to D and got stucked on multi-dimension array part. int levenshtein_distance(char *s,char*t) //Compute levenshtein distance between s and t { //Step 1 int k,i,j,n,m,cost,*d,distance; n=strlen(s); m=strlen