CLI · QUERY
Query syntax
Grammar
Whitespace separates phrase atoms, while | outside quoting and escaping separates alternatives. An atom is bare or quoted text with an optional tag.
Empty atoms, unclosed quotes, missing tag values, unknown tags, and | without an operand are compile errors.
query = alternative
alternative = sequence *(OWS "|" OWS sequence)
sequence = primary *(OWS primary)
primary = atom / "(" OWS alternative OWS ")"
atom = [pos-tag] (bare / quoted)
pos-tag = "n:" / "v:" / "adj:" / "lit:" / ...
Atoms and tags
v:걷다 permits only verb analyses, while n:걷기 permits only noun analyses. An untagged atom receives global --pos or auto.
Each phrase atom has its own analysis and program set. A tag is never propagated implicitly across the phrase.
Quoting and escaping
"로그 인" is one literal atom containing a space. " and \ preserve a quote and a backslash as characters.
Quoting an inflected lemma does not enable literal mode. Quoting changes atom boundaries; the expansion option determines morphology.
kfind 'v:걷다 "로그 인"' src
kfind --literal 'key\:value' config
Alternative search
걷다|사용자 and 걷다 | 사용자 are equivalent queries that match either atom. Each alternative may carry its own POS tag.
A B | C D chooses between phrases. Parentheses group alternatives, as in (A | B) C; --max-gap applies between ordered atoms. Escape or quote literal operators.
Quote the whole query in a CLI shell so that the shell does not interpret | as a pipe.
kfind 'v:걷다|n:사용자|n:검증' src
kfind '\|' syntax.txt
kfind '"|"' syntax.txt