textmatch

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coverage

func Coverage(want, got map[string]struct{}) float64

Coverage returns the fraction of wanted tokens present in got.

func IntersectionSize

func IntersectionSize(a, b map[string]struct{}) int

IntersectionSize returns the count of tokens present in both sets.

func Jaccard

func Jaccard(a, b map[string]struct{}) float64

Jaccard returns intersection/union similarity for two token sets.

func JaccardSignificantWords

func JaccardSignificantWords(a, b string) float64

JaccardSignificantWords returns Jaccard similarity over lower-cased word tokens after stripping common punctuation and dropping tokens shorter than three bytes.

func OverlapCoefficient

func OverlapCoefficient(a, b map[string]struct{}) float64

OverlapCoefficient returns intersection/min(len(a), len(b)) for two token sets.

func SignificantWordSet

func SignificantWordSet(s string) map[string]struct{}

SignificantWordSet tokenizes text for lightweight natural-language similarity.

Types

This section is empty.

Jump to

Keyboard shortcuts

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