oh god.. this is so cool... exactly what i wanted...
adaptive searches ... also check the "hamming code" googleit!!
one problem with this though
distance 1 : script sc*ipt or whatever other errors in single chars are easy detectable, but i need something that ca also account for caracter substraction, or adition
ex : damerau dammerau = 4 and it should be 1 ( -eek!!)
ex: dammerau damerau this returns 1 - correct
So i take it the author was accounting that first is the haystack , and second is the needle ??
What about thinking outside the box? - the search should be unshure about the needle and the haystack
both permutation should return 1 becouse between the 2 only one operation was performed on either the needle or haystack