SequenceMatcher compares sequence of strings. The basic algorithm predates, and is a little fancier than, an algorithm published in the late 1980's by Ratcliff and Obershelp under the hyperbolic name "gestalt pattern matching". The basic idea is to find the longest contiguous matching subsequence t
| 85 | // expected-case behavior dependent in a complicated way on how many |
| 86 | // elements the sequences have in common; best case time is linear. |
| 87 | type SequenceMatcher struct { |
| 88 | a []string |
| 89 | b []string |
| 90 | b2j map[string][]int |
| 91 | IsJunk func(string) bool |
| 92 | autoJunk bool |
| 93 | bJunk map[string]struct{} |
| 94 | matchingBlocks []Match |
| 95 | fullBCount map[string]int |
| 96 | bPopular map[string]struct{} |
| 97 | opCodes []OpCode |
| 98 | } |
| 99 | |
| 100 | func NewMatcher(a, b []string) *SequenceMatcher { |
| 101 | m := SequenceMatcher{autoJunk: true} |
nothing calls this directly
no outgoing calls
no test coverage detected