Documentation
¶
Overview ¶
Package textmatch provides lexical text similarity scoring — token-set overlap blended with character-trigram similarity — used to rank candidates against a query without embeddings. It complements dense semantic search by rewarding exact identifiers (table names, error strings, refs) and tolerating typos.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query holds the precomputed token and trigram sets of a query string so one query can be scored against many candidates cheaply.
func (Query) Score ¶
Score returns how well the query matches a candidate, taking the best of its fields. It blends token-set overlap (word matches like "getting started" → panda://getting-started) with trigram similarity (typo tolerance like "finalty" → finality), plus a boost when every query token appears in a field. The result is clamped to [0, 1].