a suffix array like mapping algorithm with mismatching allowed.