Documentation
¶
Overview ¶
Package patterns defines the YAML schema and loader for extraction rule sets.
A PatternSet is a collection of regex-based extraction rules keyed by language. Templates use {{subject}} and {{object}} placeholders that expand to named capture groups for SPO triple extraction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandTemplate ¶
ExpandTemplate converts a template with placeholders into a regex string.
Types ¶
type Pattern ¶
type Pattern struct {
Name string `yaml:"name"`
Predicate string `yaml:"predicate"`
Templates []string `yaml:"templates"`
Functional bool `yaml:"functional"`
Confidence float64 `yaml:"confidence"`
}
Pattern defines a single extraction rule.
type PatternSet ¶
type PatternSet struct {
Language string `yaml:"language"`
Version int `yaml:"version"`
ClauseSeparators []string `yaml:"clause_separators"`
Patterns []Pattern `yaml:"patterns"`
}
PatternSet is the top-level YAML structure for a language-specific rule file.
func Load ¶
func Load(data []byte) (*PatternSet, error)
Load reads and validates a YAML pattern file.
func (*PatternSet) Validate ¶
func (ps *PatternSet) Validate() error
Validate checks a PatternSet for correctness.
Click to show internal directories.
Click to hide internal directories.