Lines Matching refs:buf
32 func levenshtein(a, b string, ai, bi, max int, buf [][]int) int {
42 if buf[bi][ai] != 0 {
43 return buf[bi][ai]
50 res = levenshtein(a, b, ai+1, bi+1, max, buf)
52 if c := levenshtein(a, b, ai+1, bi+1, max-1, buf); c < res {
55 if c := levenshtein(a, b, ai+1, bi, max-1, buf); c < res {
58 if c := levenshtein(a, b, ai, bi+1, max-1, buf); c < res {
63 buf[bi][ai] = res
78 buf := make([][]int, len(name)+kAllowedDifferences)
79 for i := range buf {
80 buf[i] = make([]int, len(name))
93 l := levenshtein(name, other, 0, 0, kAllowedDifferences, buf)
108 for _, v := range buf {