lcs

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 added in v0.5.0

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

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

func DiffRunes added in v0.5.0

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

DiffRunes returns the differences between two rune sequences.

func DiffStrings added in v0.5.0

func DiffStrings(a, b string) []Diff

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL