lcs

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 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

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.

Jump to

Keyboard shortcuts

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