MCPcopy Create free account
hub / github.com/pmezard/go-difflib / SequenceMatcher

Struct SequenceMatcher

difflib/difflib.go:87–98  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

85// expected-case behavior dependent in a complicated way on how many
86// elements the sequences have in common; best case time is linear.
87type 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
100func NewMatcher(a, b []string) *SequenceMatcher {
101 m := SequenceMatcher{autoJunk: true}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected