Documentation
¶
Index ¶
- Constants
- func DiffPrettyHtml(diffs []Diff) string
- type Diff
- type DiffMatchPatch
- func (dmp *DiffMatchPatch) DiffBisectSplit(textA, textB []rune, x, y int, deadline time.Time) []Diff
- func (dmp *DiffMatchPatch) DiffBisect_(textA, textB string, deadline time.Time) []Diff
- func (dmp *DiffMatchPatch) DiffCharsToLines(diffs []Diff, lineArray []string) []Diff
- func (dmp *DiffMatchPatch) DiffCleanupEfficiency(diffs []Diff) []Diff
- func (dmp *DiffMatchPatch) DiffCleanupMerge(diffs []Diff) (error, []Diff)
- func (dmp *DiffMatchPatch) DiffCleanupSemantic(diffs []Diff) []Diff
- func (dmp *DiffMatchPatch) DiffCleanupSemanticLossless(diffs []Diff) []Diff
- func (dmp *DiffMatchPatch) DiffCleanupSemanticScore(one, two string) int
- func (dmp *DiffMatchPatch) DiffCommonOverlap(textA, textB string) int
- func (dmp *DiffMatchPatch) DiffCommonPrefix(textA, textB []rune) int
- func (dmp *DiffMatchPatch) DiffCommonSuffix(textA, textB []rune) int
- func (dmp *DiffMatchPatch) DiffCommonSuffixString(textA, textB string) int
- func (dmp *DiffMatchPatch) DiffCompute(textA, textB []rune, checklines bool, deadline time.Time) []Diff
- func (dmp *DiffMatchPatch) DiffHalfMatch(textA, textB []rune) ([]rune, []rune, []rune, []rune, []rune)
- func (dmp *DiffMatchPatch) DiffHalfMatchI(longtext, shorttext []rune, i int) ([]rune, []rune, []rune, []rune, []rune)
- func (dmp *DiffMatchPatch) DiffLineMode(textA, textB []rune, deadline time.Time) []Diff
- func (dmp *DiffMatchPatch) DiffLinesToChars(textA, textB string) ([]rune, []rune, []string)
- func (dmp *DiffMatchPatch) DiffLinesToCharsMunge(text string, lineArray []string, lineHash map[string]int) []rune
- func (dmp *DiffMatchPatch) DiffLinesToRunes(text1, text2 string) ([]rune, []rune, []string)
- func (dmp *DiffMatchPatch) DiffLinesToStrings(text1, text2 string) (string, string, []string)
- func (dmp *DiffMatchPatch) DiffLinesToStringsMunge(text string, lineArray *[]string, lineHash map[string]int) []uint32
- func (dmp *DiffMatchPatch) DiffMain(inputA, inputB []rune, checklines bool) (error, []Diff)
- func (dmp *DiffMatchPatch) DiffMainDeadline(inputA, inputB []rune, checklines bool, deadline time.Time) (error, []Diff)
- func (dmp *DiffMatchPatch) DiffRecurse(inputA, inputB string) (error, []Diff)
- func (dmp *DiffMatchPatch) DiffTextResult(diffs []Diff) string
- func (dmp *DiffMatchPatch) DiffTextSource(diffs []Diff) string
- type Operation
Constants ¶
const FOUR_BYTE_BITS = 21
const ONE_BYTE_BITS = 7
These constants define the number of bits representable in 1,2,3,4 byte utf8 sequences, respectively.
const THREE_BYTE_BITS = 16
const TWO_BYTE_BITS = 11
const UNICODE_INVALID_RANGE_DELTA = UNICODE_INVALID_RANGE_END - UNICODE_INVALID_RANGE_START + 1
const UNICODE_INVALID_RANGE_END = 0xDFFF
const UNICODE_INVALID_RANGE_START = 0xD800
const UNICODE_RANGE_MAX = 0x10FFFF
Variables ¶
This section is empty.
Functions ¶
func DiffPrettyHtml ¶
* diff_prettyHtml Convert a diff array into a pretty HTML report.
Types ¶
type DiffMatchPatch ¶
type DiffMatchPatch struct { // Number of seconds to map a diff before giving up (0 for infinity). Diff_Timeout time.Duration // Cost of an empty edit operation in terms of edit characters. Diff_EditCost uint16 // At what point is no match declared (0.0 = perfection, 1.0 = very loose). Match_Threshold float32 // 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). Match_Distance int32 // When deleting a large block of text (over ~64 characters), how close does // the contents have to match the expected contents. (0.0 = perfection, // 1.0 = very loose). Note that Match_Threshold controls how closely the // end points of a delete need to match. Patch_DeleteThreshold float32 // Chunk size for context length. Patch_Margin uint16 // The number of bits in an int. Match_MaxBits uint16 }
func New ¶
func New() *DiffMatchPatch
func (*DiffMatchPatch) DiffBisectSplit ¶
func (dmp *DiffMatchPatch) DiffBisectSplit(textA, textB []rune, x, y int, deadline time.Time) []Diff
* diffBisectSplit
func (*DiffMatchPatch) DiffBisect_ ¶
func (dmp *DiffMatchPatch) DiffBisect_(textA, textB string, deadline time.Time) []Diff
* diffBisect_
func (*DiffMatchPatch) DiffCharsToLines ¶
func (dmp *DiffMatchPatch) DiffCharsToLines(diffs []Diff, lineArray []string) []Diff
* diffCharsToLines
func (*DiffMatchPatch) DiffCleanupEfficiency ¶
func (dmp *DiffMatchPatch) DiffCleanupEfficiency(diffs []Diff) []Diff
* diffCleanupEfficiency - used by patch, skip
func (*DiffMatchPatch) DiffCleanupMerge ¶
func (dmp *DiffMatchPatch) DiffCleanupMerge(diffs []Diff) (error, []Diff)
* diff_xIndex - used by patch, skip * diffCleanupMerge
func (*DiffMatchPatch) DiffCleanupSemantic ¶
func (dmp *DiffMatchPatch) DiffCleanupSemantic(diffs []Diff) []Diff
* diffCleanupSemantic
func (*DiffMatchPatch) DiffCleanupSemanticLossless ¶
func (dmp *DiffMatchPatch) DiffCleanupSemanticLossless(diffs []Diff) []Diff
* diffCleanupSemanticLossless
func (*DiffMatchPatch) DiffCleanupSemanticScore ¶
func (dmp *DiffMatchPatch) DiffCleanupSemanticScore(one, two string) int
* diffCleanupSemanticScore
func (*DiffMatchPatch) DiffCommonOverlap ¶
func (dmp *DiffMatchPatch) DiffCommonOverlap(textA, textB string) int
* diffCommonOverlap
func (*DiffMatchPatch) DiffCommonPrefix ¶
func (dmp *DiffMatchPatch) DiffCommonPrefix(textA, textB []rune) int
* diffCommonPrefix
func (*DiffMatchPatch) DiffCommonSuffix ¶
func (dmp *DiffMatchPatch) DiffCommonSuffix(textA, textB []rune) int
* diffCommonSuffix
func (*DiffMatchPatch) DiffCommonSuffixString ¶
func (dmp *DiffMatchPatch) DiffCommonSuffixString(textA, textB string) int
func (*DiffMatchPatch) DiffCompute ¶
func (dmp *DiffMatchPatch) DiffCompute(textA, textB []rune, checklines bool, deadline time.Time) []Diff
* diffCompute_
func (*DiffMatchPatch) DiffHalfMatch ¶
func (dmp *DiffMatchPatch) DiffHalfMatch(textA, textB []rune) ([]rune, []rune, []rune, []rune, []rune)
* diffHalfMatch
func (*DiffMatchPatch) DiffHalfMatchI ¶
func (dmp *DiffMatchPatch) DiffHalfMatchI(longtext, shorttext []rune, i int) ([]rune, []rune, []rune, []rune, []rune)
* diffHalfMatchI
func (*DiffMatchPatch) DiffLineMode ¶
func (dmp *DiffMatchPatch) DiffLineMode(textA, textB []rune, deadline time.Time) []Diff
* diffLineMode_
func (*DiffMatchPatch) DiffLinesToChars ¶
func (dmp *DiffMatchPatch) DiffLinesToChars(textA, textB string) ([]rune, []rune, []string)
* diffLinesToChars - ********* @todo: fix this!! ********
func (*DiffMatchPatch) DiffLinesToCharsMunge ¶
func (dmp *DiffMatchPatch) DiffLinesToCharsMunge(text string, lineArray []string, lineHash map[string]int) []rune
* diffLinestoCharsMunge
func (*DiffMatchPatch) DiffLinesToRunes ¶
func (dmp *DiffMatchPatch) DiffLinesToRunes(text1, text2 string) ([]rune, []rune, []string)
func (*DiffMatchPatch) DiffLinesToStrings ¶
func (dmp *DiffMatchPatch) DiffLinesToStrings(text1, text2 string) (string, string, []string)
func (*DiffMatchPatch) DiffLinesToStringsMunge ¶
func (*DiffMatchPatch) DiffMain ¶
func (dmp *DiffMatchPatch) DiffMain(inputA, inputB []rune, checklines bool) (error, []Diff)
Recursive diff method setting a deadline
func (*DiffMatchPatch) DiffMainDeadline ¶
func (dmp *DiffMatchPatch) DiffMainDeadline(inputA, inputB []rune, checklines bool, deadline time.Time) (error, []Diff)
Diff method with deadline
func (*DiffMatchPatch) DiffRecurse ¶
func (dmp *DiffMatchPatch) DiffRecurse(inputA, inputB string) (error, []Diff)
The default diff entry method, sets checklines to true and continues
func (*DiffMatchPatch) DiffTextResult ¶
func (dmp *DiffMatchPatch) DiffTextResult(diffs []Diff) string
func (*DiffMatchPatch) DiffTextSource ¶
func (dmp *DiffMatchPatch) DiffTextSource(diffs []Diff) string