(t, p string)
| 8 | var ErrNotFound = errors.New("pattern was not found in the input string") |
| 9 | |
| 10 | func Horspool(t, p string) (int, error) { |
| 11 | // in order to handle multy-byte character properly |
| 12 | // the input is converted into rune arrays |
| 13 | return horspool([]rune(t), []rune(p)) |
| 14 | } |
| 15 | |
| 16 | func horspool(t, p []rune) (int, error) { |
| 17 | shiftMap := computeShiftMap(t, p) |