Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MatchResult ¶
type MatchResult struct {
// Exact is true when query matched a single name exactly (case-insensitive).
Exact bool
// Matched is the best single match when confidence is above threshold.
Matched string
// Candidates lists all names that scored above threshold when multiple matched.
Candidates []string
}
MatchResult describes the outcome of a fuzzy match attempt.
func Match ¶
func Match(query string, names []string, threshold int) (MatchResult, error)
Match resolves a partial query against a list of registered repo names. threshold is a value between 1 and 100 (default 50).
Returns:
- MatchResult{Exact: true, Matched: name} for an exact (case-insensitive) hit.
- MatchResult{Matched: name} when exactly one candidate is above threshold.
- MatchResult{Candidates: [...] } when multiple candidates are above threshold.
- error when no candidates are found.
Click to show internal directories.
Click to hide internal directories.