Documentation
¶
Overview ¶
Package glossary auto-extracts korean → english keyword mappings from markdown documents (typically a project's .claude/docs/ tree) and emits the AliasMap YAML that `ckv query --alias` consumes.
Pattern coverage (v1):
Markdown table rows with a korean key cell and an english value cell: `| 합의 알고리즘 | WBFT (Weemix Byzantine Fault Tolerance) |` extracts `합의 알고리즘 → [WBFT, Weemix Byzantine Fault Tolerance]`.
Inline parenthetical glosses: `합의 알고리즘 (consensus engine)` or `검증인 (validator)`. Body-text pattern, picks up terminology that never makes it into a table.
Both patterns require the *key* to contain at least one Hangul syllable so we never alias an english phrase to itself. Values are deduplicated and sorted before being written to YAML.
Non-goals for v1: section headings, bold-bold rewriting, semantic translation. Add only when a measurement shows the existing extractor misses a class of useful entries.
Output format matches internal/query.AliasFile so the produced YAML is directly consumable by `ckv query --alias`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
Extract walks every *.md / *.markdown file under root and returns the union AliasMap of all extracted patterns. Files are read with streaming line scanning so the function handles repo-sized doc trees without loading everything into memory.
Returns an empty (non-nil) map when no aliases are found — callers can write it out unconditionally.
func ExtractLine ¶
ExtractLine applies the v1 patterns to one line and merges into accum. Exposed so callers (tests, future stream sources) can drive extraction without a file system.