From: Brendan Stennett Date: 2008-04-03T14:25:59+09:00 Subject: Re: String 'close-to' comparison. If you know all the possibilities that your OCR system *could* pick up then you could always do something like this... knownStrings = ['Hello','Goodbye'] out = [] OCR_strings = #new array of strings OCR_strings.each do |ocr| matches,len = 0,0 knownStrings.each do |known| len = known.length (len-1).times do |i| if (i+1) >= ocr.length break else if ocr[i] == known[i] matches += 1 end end if matches / known.length > 0.85 out << known else out << "!#{known}" end end end end ...completely untested but i think you know what im getting at -- Posted via http://www.ruby-forum.com/.