88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
return result
}
// Finds the largest common substring by looking at the provided match matrix
// starting from (bounds.x, bounds.y) with lengths bounds.lenX, bounds.lenY
func largest(bounds box, mat matrix) (result match) {
for i := bounds.x; i < bounds.lenX; i++ {
var m match = search(i, bounds.y, bounds.lenX, bounds.lenY, mat)
if m.length > result.length {
result = m
}
}
for j := bounds.y + 1; j < bounds.lenY; j++ {
var m match = search(bounds.x, j, bounds.lenX, bounds.lenY, mat)
if m.length > result.length {
result = m
}
}
return
}
|
|
|
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
return result
}
// Finds the largest common substring by looking at the provided match matrix
// starting from (bounds.x, bounds.y) with lengths bounds.lenX, bounds.lenY
func largest(bounds box, mat matrix) (result match) {
for i := bounds.x; i < bounds.lenX && result.length <= (bounds.lenX-bounds.x); i++ {
var m match = search(i, bounds.y, bounds.lenX, bounds.lenY, mat)
if m.length > result.length {
result = m
}
}
for j := bounds.y + 1; j < bounds.lenY && result.length <= (bounds.lenY-bounds.y); j++ {
var m match = search(bounds.x, j, bounds.lenX, bounds.lenY, mat)
if m.length > result.length {
result = m
}
}
return
}
|