MCPcopy Create free account

hub / github.com/sergi/go-diff / functions

Functions118 in github.com/sergi/go-diff

↓ 42 callersFunctionNew
New creates a new DiffMatchPatch object with default parameters.
diffmatchpatch/diffmatchpatch.go:35
↓ 17 callersMethodDiffMain
DiffMain finds the differences between two texts. If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement characte
diffmatchpatch/diff.go:84
↓ 12 callersMethodPatchMake
PatchMake computes a list of patches.
diffmatchpatch/patch.go:115
↓ 12 callersFunctionsplice
splice removes amount elements from slice at index index, replacing them with elements.
diffmatchpatch/diff.go:46
↓ 11 callersMethodString
String emulates GNU diff's format. Header: @@ -382,8 +481,9 @@ Indices are printed as 1-based, not 0-based.
diffmatchpatch/patch.go:33
↓ 9 callersMethodDiffText1
DiffText1 computes and returns the source text (all equalities and deletions).
diffmatchpatch/diff.go:1180
↓ 9 callersFunctiongetBits
Helper for getting a sequence of bits from an integer.
diffmatchpatch/stringutil.go:116
↓ 8 callersMethodMatchBitap
MatchBitap locates the best instance of 'pattern' in 'text' near 'loc' using the Bitap algorithm. Returns -1 if no match was found.
diffmatchpatch/match.go:37
↓ 7 callersMethodDiffCharsToLines
DiffCharsToLines rehydrates the text in a diff from a string of line hashes to real lines of text.
diffmatchpatch/diff.go:404
↓ 7 callersMethoddiffMainRunes
(text1, text2 []rune, checklines bool, deadline time.Time)
diffmatchpatch/diff.go:98
↓ 6 callersMethodPatchToText
PatchToText takes a list of patches and returns a textual representation.
diffmatchpatch/patch.go:469
↓ 6 callersFunctioncommonPrefixLength
commonPrefixLength returns the length of the common prefix of two rune slices.
diffmatchpatch/diff.go:433
↓ 6 callersFunctioncommonSuffixLength
commonSuffixLength returns the length of the common suffix of two rune slices.
diffmatchpatch/diff.go:445
↓ 5 callersMethodMatchMain
MatchMain locates the best instance of 'pattern' in 'text' near 'loc'. Returns -1 if no match found.
diffmatchpatch/match.go:17
↓ 5 callersMethodmatchBitapScore
matchBitapScore computes and returns the score for a match with e errors and x location.
diffmatchpatch/match.go:128
↓ 5 callersFunctionmax
(x, y int)
diffmatchpatch/mathutil.go:18
↓ 4 callersMethodDiffCleanupMerge
DiffCleanupMerge reorders and merges like edit sections. Merge equalities. Any edit section can move as long as it doesn't cross an equality.
diffmatchpatch/diff.go:958
↓ 4 callersMethodDiffCleanupSemantic
DiffCleanupSemantic reduces the number of edits by eliminating semantically trivial equalities.
diffmatchpatch/diff.go:606
↓ 4 callersMethodDiffFromDelta
DiffFromDelta given the original text1, and an encoded string which describes the operations required to transform text1 into text2, comAdde the full
diffmatchpatch/diff.go:1261
↓ 4 callersMethodDiffLinesToChars
DiffLinesToChars splits two texts into a list of strings, and educes the texts to a string of hashes where each Unicode character represents one line.
diffmatchpatch/diff.go:392
↓ 4 callersMethodDiffText2
DiffText2 computes and returns the destination text (all equalities and insertions).
diffmatchpatch/diff.go:1193
↓ 4 callersMethodPatchApply
PatchApply merges a set of patches onto the text. Returns a patched text, as well as an array of true/false values indicating which patches were appl
diffmatchpatch/patch.go:232
↓ 4 callersMethodPatchFromText
PatchFromText parses a textual representation of patches and returns a List of Patch objects.
diffmatchpatch/patch.go:478
↓ 4 callersFunctiondiffCleanupSemanticScore
diffCleanupSemanticScore computes a score representing whether the internal boundary falls on logical boundaries. Scores range from 6 (best) to 0 (wor
diffmatchpatch/diff.go:732
↓ 4 callersFunctionspeedtestTexts
()
diffmatchpatch/benchutil_test.go:17
↓ 3 callersMethodDiffCleanupEfficiency
DiffCleanupEfficiency reduces the number of edits by eliminating operationally trivial equalities.
diffmatchpatch/diff.go:847
↓ 3 callersMethodDiffCleanupSemanticLossless
DiffCleanupSemanticLossless looks for single edits surrounded on both sides by equalities which can be shifted sideways to align the edit to a word bo
diffmatchpatch/diff.go:774
↓ 3 callersMethodDiffCommonOverlap
DiffCommonOverlap determines if the suffix of one string is the prefix of another.
diffmatchpatch/diff.go:460
↓ 3 callersMethodDiffCommonSuffix
DiffCommonSuffix determines the common suffix length of two strings.
diffmatchpatch/diff.go:427
↓ 3 callersMethodDiffHalfMatch
DiffHalfMatch checks whether the two texts share a substring which is at least half the length of the longer text. This speedup can produce non-minima
diffmatchpatch/diff.go:500
↓ 3 callersMethodDiffLinesToRunes
DiffLinesToRunes splits two texts into a list of runes.
diffmatchpatch/diff.go:398
↓ 3 callersMethodDiffMainRunes
DiffMainRunes finds the differences between two rune sequences. If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replac
diffmatchpatch/diff.go:90
↓ 3 callersMethodDiffToDelta
DiffToDelta crushes the diff into an encoded string which describes the operations required to transform text1 into text2. E.g. =3\t-2\t+ing -> Keep
diffmatchpatch/diff.go:1230
↓ 3 callersMethodDiffXIndex
DiffXIndex returns the equivalent location in s2.
diffmatchpatch/diff.go:1085
↓ 3 callersMethodPatchAddContext
PatchAddContext increases the context until it is unique, but doesn't let the pattern expand beyond MatchMaxBits.
diffmatchpatch/patch.go:74
↓ 3 callersMethoddiffBisectSplit
(runes1, runes2 []rune, x, y int, deadline time.Time)
diffmatchpatch/diff.go:376
↓ 3 callersFunctionindexOf
indexOf returns the first index of pattern in str, starting at str[i].
diffmatchpatch/stringutil.go:32
↓ 3 callersFunctionindexesToString
(indexes []index)
diffmatchpatch/index.go:22
↓ 3 callersFunctionintToRune
Converts an integer in the range 0~1112060 into a rune. Based on the ranges table in https://en.wikipedia.org/wiki/UTF-8
diffmatchpatch/stringutil.go:122
↓ 3 callersFunctionmin
(x, y int)
diffmatchpatch/mathutil.go:11
↓ 3 callersFunctionrunesIndex
runesIndex is the equivalent of strings.Index for rune slices.
diffmatchpatch/stringutil.go:86
↓ 3 callersFunctionrunesIndexOf
runesIndexOf returns the index of pattern in target, starting at target[i].
diffmatchpatch/stringutil.go:59
↓ 2 callersMethodDiffBisect
DiffBisect finds the 'middle snake' of a diff, split the problem in two and return the recursively constructed diff. If an invalid UTF-8 sequence is e
diffmatchpatch/diff.go:254
↓ 2 callersMethodDiffCommonPrefix
DiffCommonPrefix determines the common prefix length of two strings.
diffmatchpatch/diff.go:421
↓ 2 callersMethodDiffLevenshtein
DiffLevenshtein computes the Levenshtein distance that is the number of inserted, deleted or substituted characters.
diffmatchpatch/diff.go:1205
↓ 2 callersMethodMatchAlphabet
MatchAlphabet initialises the alphabet for the Bitap algorithm.
diffmatchpatch/match.go:143
↓ 2 callersMethodPatchAddPadding
PatchAddPadding adds some padding on text start and end so that edges can match something. Intended to be called only from within patchApply.
diffmatchpatch/patch.go:323
↓ 2 callersMethodPatchSplitMax
PatchSplitMax looks through the patches and breaks up any which are longer than the maximum limit of the match algorithm. Intended to be called only f
diffmatchpatch/patch.go:375
↓ 2 callersMethoddiffBisect
diffBisect finds the 'middle snake' of a diff, splits the problem in two and returns the recursively constructed diff. See Myers's 1986 paper: An O(ND
diffmatchpatch/diff.go:261
↓ 2 callersMethoddiffHalfMatch
(text1, text2 []rune)
diffmatchpatch/diff.go:514
↓ 2 callersMethoddiffHalfMatchI
diffHalfMatchI checks if a substring of shorttext exist within longtext such that the substring is at least half the length of longtext? Returns a sli
diffmatchpatch/diff.go:565
↓ 2 callersMethoddiffLinesToStrings
diffLinesToStrings splits two texts into a list of strings. Each string represents one line.
diffmatchpatch/diff.go:1322
↓ 2 callersMethoddiffLinesToStringsMunge
diffLinesToStringsMunge splits a text into an array of strings, and reduces the texts to a []index.
diffmatchpatch/diff.go:1334
↓ 2 callersFunctiondiffRebuildTexts
(diffs []Diff)
diffmatchpatch/diff_test.go:48
↓ 2 callersFunctionintArrayToString
(ns []index)
diffmatchpatch/stringutil.go:96
↓ 2 callersFunctionlastIndexOf
lastIndexOf returns the last index of pattern in str, starting at str[i].
diffmatchpatch/stringutil.go:47
↓ 2 callersFunctionruneToInt
Converts a rune generated by intToRune back to an integer
diffmatchpatch/stringutil.go:161
↓ 2 callersFunctionrunesEqual
(r1, r2 []rune)
diffmatchpatch/stringutil.go:73
↓ 1 callersMethodDiffPrettyHtml
DiffPrettyHtml converts a []Diff into a pretty HTML report. It is intended as an example from which to write one's own display functions.
diffmatchpatch/diff.go:1119
↓ 1 callersMethodDiffPrettyText
DiffPrettyText converts a []Diff into a colored text report.
diffmatchpatch/diff.go:1142
↓ 1 callersMethodPatchDeepCopy
PatchDeepCopy returns an array that is identical to a given an array of patches.
diffmatchpatch/patch.go:212
↓ 1 callersMethoddiffCompute
diffCompute finds the differences between two rune slices. Assumes that the texts do not have any common prefix or suffix.
diffmatchpatch/diff.go:133
↓ 1 callersMethoddiffLineMode
diffLineMode does a quick line-level diff on both []runes, then rediff the parts for greater accuracy. This speedup can produce non-minimal diffs.
diffmatchpatch/diff.go:194
↓ 1 callersMethodpatchMake2
patchMake2 computes a list of patches to turn text1 into text2. text2 is not provided, diffs are the delta between text1 and text2.
diffmatchpatch/patch.go:141
↓ 1 callersFunctionstringToIndex
next invalid code point
diffmatchpatch/index.go:9
FunctionBenchmarkCommonLength
(b *testing.B)
diffmatchpatch/diff_test.go:149
FunctionBenchmarkDiffCleanupSemantic
(b *testing.B)
diffmatchpatch/diff_test.go:872
FunctionBenchmarkDiffCommonPrefix
(b *testing.B)
diffmatchpatch/diff_test.go:85
FunctionBenchmarkDiffCommonSuffix
exported sink var to avoid compiler optimizations in benchmarks
diffmatchpatch/diff_test.go:137
FunctionBenchmarkDiffHalfMatch
(b *testing.B)
diffmatchpatch/diff_test.go:270
FunctionBenchmarkDiffMain
(bench *testing.B)
diffmatchpatch/diff_test.go:1514
FunctionBenchmarkDiffMainLarge
(b *testing.B)
diffmatchpatch/diff_test.go:1534
FunctionBenchmarkDiffMainRunesLargeDiffLines
(b *testing.B)
diffmatchpatch/diff_test.go:1561
FunctionBenchmarkDiffMainRunesLargeLines
(b *testing.B)
diffmatchpatch/diff_test.go:1546
MethodString
()
diffmatchpatch/operation_string.go:11
FunctionTestCommonPrefixLength
(t *testing.T)
diffmatchpatch/diff_test.go:95
FunctionTestCommonSuffixLength
(t *testing.T)
diffmatchpatch/diff_test.go:181
FunctionTestDiffBisect
(t *testing.T)
diffmatchpatch/diff_test.go:1218
FunctionTestDiffBisectSplit
(t *testing.T)
diffmatchpatch/diff_test.go:282
FunctionTestDiffCharsToLines
(t *testing.T)
diffmatchpatch/diff_test.go:350
FunctionTestDiffCleanupEfficiency
(t *testing.T)
diffmatchpatch/diff_test.go:886
FunctionTestDiffCleanupMerge
(t *testing.T)
diffmatchpatch/diff_test.go:395
FunctionTestDiffCleanupSemantic
(t *testing.T)
diffmatchpatch/diff_test.go:616
FunctionTestDiffCleanupSemanticLossless
(t *testing.T)
diffmatchpatch/diff_test.go:478
FunctionTestDiffCommonOverlap
(t *testing.T)
diffmatchpatch/diff_test.go:200
FunctionTestDiffCommonPrefix
(t *testing.T)
diffmatchpatch/diff_test.go:63
FunctionTestDiffCommonSuffix
(t *testing.T)
diffmatchpatch/diff_test.go:113
FunctionTestDiffDelta
(t *testing.T)
diffmatchpatch/diff_test.go:1087
FunctionTestDiffHalfMatch
(t *testing.T)
diffmatchpatch/diff_test.go:225
FunctionTestDiffLevenshtein
(t *testing.T)
diffmatchpatch/diff_test.go:1197
FunctionTestDiffLinesToChars
(t *testing.T)
diffmatchpatch/diff_test.go:304
FunctionTestDiffMain
(t *testing.T)
diffmatchpatch/diff_test.go:1274
FunctionTestDiffMainWithCheckLines
(t *testing.T)
diffmatchpatch/diff_test.go:1434
FunctionTestDiffMainWithTimeout
(t *testing.T)
diffmatchpatch/diff_test.go:1409
FunctionTestDiffPartialLineIndex
(t *testing.T)
diffmatchpatch/diff_test.go:1482
FunctionTestDiffPrettyHtml
(t *testing.T)
diffmatchpatch/diff_test.go:992
FunctionTestDiffPrettyText
(t *testing.T)
diffmatchpatch/diff_test.go:1017
FunctionTestDiffText
(t *testing.T)
diffmatchpatch/diff_test.go:1053
FunctionTestDiffXIndex
(t *testing.T)
diffmatchpatch/diff_test.go:1176
FunctionTestIndexConversion
(t *testing.T)
diffmatchpatch/index_test.go:8
next →1–100 of 118, ranked by callers