Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Vocab ¶
type Vocab struct {
// Aliases maps a non-canonical form to its canonical replacement.
// Keys and values should be lowercase-hyphenated; Title Case forms are
// normalised automatically before lookup.
Aliases map[string]string `yaml:"aliases"`
// Drop lists tokens to silently remove after alias resolution.
Drop []string `yaml:"drop"`
// contains filtered or unexported fields
}
Vocab holds the canonical tag/category vocabulary loaded from categories.yaml.
func Load ¶
Load reads and parses a categories.yaml file. Returns an empty Vocab if the file does not exist, so callers can treat "no file" as "no rules".
func (Vocab) ApplyToCSV ¶
ApplyToCSV applies normalisation and rules to a comma-separated user_tags string and returns the result plus whether anything changed.
func (Vocab) ApplyToTokens ¶
ApplyToTokens normalises every token to lowercase-hyphenated form, applies alias resolution and drop rules, and collapses duplicates. It always normalises — even when no Vocab rules are loaded.
func (Vocab) PromptSection ¶
PromptSection renders a concise vocabulary block for the LLM system prompt.