pydifflib

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCloseMatches

func GetCloseMatches(word string, possibilities []string, n int, cutoff float64) []string

Best n possibilities scoring at least cutoff against word, highest score then greatest text first

Types

type Match

type Match struct{ I, J, Size int }

One matching block of size elements starting at I in a and J in b

type SequenceMatcher

type SequenceMatcher[T comparable] struct {
	// contains filtered or unexported fields
}

Port of difflib.SequenceMatcher without a junk predicate, with autojunk popularity purging

func NewSequenceMatcher

func NewSequenceMatcher[T comparable](a, b []T, autojunk bool) *SequenceMatcher[T]

Matcher over a and b the way SequenceMatcher(None, a, b, autojunk) builds it

func (*SequenceMatcher[T]) MatchingBlocks

func (m *SequenceMatcher[T]) MatchingBlocks() []Match

Non adjacent matching blocks in order, ending with the zero size sentinel

func (*SequenceMatcher[T]) Ratio

func (m *SequenceMatcher[T]) Ratio() float64

Twice the matched elements over the combined length, one for two empty sequences

Jump to

Keyboard shortcuts

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