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

Struct DiffMatchPatch

diffmatchpatch/diffmatchpatch.go:17–32  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

15
16// DiffMatchPatch holds the configuration for diff-match-patch operations.
17type DiffMatchPatch struct {
18 // Number of seconds to map a diff before giving up (0 for infinity).
19 DiffTimeout time.Duration
20 // Cost of an empty edit operation in terms of edit characters.
21 DiffEditCost int
22 // 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).
23 MatchDistance int
24 // 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.
25 PatchDeleteThreshold float64
26 // Chunk size for context length.
27 PatchMargin int
28 // The number of bits in an int.
29 MatchMaxBits int
30 // At what point is no match declared (0.0 = perfection, 1.0 = very loose).
31 MatchThreshold float64
32}
33
34// New creates a new DiffMatchPatch object with default parameters.
35func New() *DiffMatchPatch {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected