package lcs

import "cuelang.org/go/internal/golangorgx/tools/diff/lcs"

package lcs contains code to find longest-common-subsequences (and diffs)

Index

Types

type Diff

type Diff struct {
	Start, End         int // offsets of portion to delete in A
	ReplStart, ReplEnd int // offset of replacement text in B
}

A Diff is a replacement of a portion of A by a portion of B.

func DiffBytes

func DiffBytes(a, b []byte) []Diff

DiffBytes returns the differences between two byte sequences. It does not respect rune boundaries.

func DiffRunes

func DiffRunes(a, b []rune) []Diff

DiffRunes returns the differences between two rune sequences.

func DiffStrings

func DiffStrings(a, b string) []Diff

DiffStrings returns the differences between two strings. It does not respect rune boundaries.

Source Files

common.go doc.go labels.go old.go sequence.go

Version
v0.12.0 (latest)
Published
Jan 30, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
8 hours ago

Tools for package owners.