MCPcopy Create free account
hub / github.com/sergi/go-diff / DiffMatchPatch

Struct DiffMatchPatch

diffmatchpatch/diffmatchpatch.go:18–33  ·  view source on GitHub ↗

DiffMatchPatch holds the configuration for diff-match-patch operations.

Source from the content-addressed store, hash-verified

16
17// DiffMatchPatch holds the configuration for diff-match-patch operations.
18type DiffMatchPatch struct {
19 // Number of seconds to map a diff before giving up (0 for infinity).
20 DiffTimeout time.Duration
21 // Cost of an empty edit operation in terms of edit characters.
22 DiffEditCost int
23 // How far to search for a match (0 = exact location, 1000+ = broad match). A match this many characters away from the expected location will add 1.0 to the score (0.0 is a perfect match).
24 MatchDistance int
25 // When deleting a large block of text (over ~64 characters), how close do the contents have to be to match the expected contents. (0.0 = perfection, 1.0 = very loose). Note that MatchThreshold controls how closely the end points of a delete need to match.
26 PatchDeleteThreshold float64
27 // Chunk size for context length.
28 PatchMargin int
29 // The number of bits in an int.
30 MatchMaxBits int
31 // At what point is no match declared (0.0 = perfection, 1.0 = very loose).
32 MatchThreshold float64
33}
34
35// New creates a new DiffMatchPatch object with default parameters.
36func New() *DiffMatchPatch {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected