Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IngestEntities ¶
func IngestEntities(db *sql.DB, graph *EntityGraph) error
IngestEntities loads entities.yaml into the database
Types ¶
type AliasMatch ¶
AliasMatch represents a found alias and its canonical entity
func ExpandQuery ¶
ExpandQuery replaces aliases with canonical names and adds context. Sorts matches by alias length (longest first) to prevent partial corruption (e.g., "the tree" must be replaced before "tree" gets a chance).
func LookupAliases ¶
func LookupAliases(db *sql.DB, query string) ([]AliasMatch, error)
LookupAliases finds all entity aliases mentioned in the query. Uses word boundaries for ASCII aliases to prevent substring false positives (e.g., alias "AB" must not match inside "ABC").
type Entity ¶
type Entity struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Aliases []string `yaml:"aliases"`
Description string `yaml:"description"`
}
Entity represents a named concept with aliases for query expansion
type EntityGraph ¶
type EntityGraph struct {
Entities []Entity `yaml:"entities"`
}
EntityGraph holds the entity list loaded from entities.yaml
func LoadEntityGraph ¶
func LoadEntityGraph(path string) (*EntityGraph, error)
LoadEntityGraph reads and parses entities.yaml