Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Match ¶
type Match struct{ I, J, Size int }
One matching block of size elements starting at I in a and J in b
type SequenceMatcher ¶
type SequenceMatcher[T comparable] struct { // contains filtered or unexported fields }
Port of difflib.SequenceMatcher without a junk predicate, with autojunk popularity purging
func NewSequenceMatcher ¶
func NewSequenceMatcher[T comparable](a, b []T, autojunk bool) *SequenceMatcher[T]
Matcher over a and b the way SequenceMatcher(None, a, b, autojunk) builds it
func (*SequenceMatcher[T]) MatchingBlocks ¶
func (m *SequenceMatcher[T]) MatchingBlocks() []Match
Non adjacent matching blocks in order, ending with the zero size sentinel
func (*SequenceMatcher[T]) Ratio ¶
func (m *SequenceMatcher[T]) Ratio() float64
Twice the matched elements over the combined length, one for two empty sequences