From: Chris Hulan Date: 2010-09-28T01:25:10+09:00 Subject: Re: levenshtein function issue On Sep 26, 12:43 am, Joe Smith wrote: > Chris Hulan wrote: > > ... > > >> d = Array2D.new(m+1,n-1) > > > You have 'n-1' here, but subsequently use indexes up to n. > > > cheers > > Thanks for the reply.  Yes, but when I change that, I just get an > error... (that's why I had originally changed it) > -- > Posted viahttp://www.ruby-forum.com/. Looking at the description at http://www.levenshtein.net/ it appears that both m and n should be +1 The strings are then offset to allow indexing from 1. Guess you either need to add a character (blank?) to the beginning of both strings, or adjust your indexes into s and t (the 1st char is the 0th index) I'm totally pulling this out of my head, as I don't have Ruby on my work computer