nx_grammar.nx
buildroot/runtime/nx_grammar.nx
about
nx_grammar.nx -- WRITING arc, rung W-R2g: MECHANICAL grammar checks.
Content-agnostic, deterministic, dictionary-FREE. Honest scope: these are the
mechanical checks an editor catches by pattern, NOT full ML/Grammarly-class
grammar -- dictionary spell-check + suggestion ranking is a later sub-arc. This
fills the lone honest gap in the W-EXC-1 census with a real, exact organ.
Checks (out[], filled by gr_check):
out[0] = doubled words -- the same word twice in a row ("the the")
out[1] = a/an misuse -- "a" before a vowel, or "an" before a consonant
(letter heuristic; a/e/i/o/u are vowels, not y/h)
out[2] = cap-after-period -- a lowercase word right after . ! or ?
returns the total error count.
Pure integer, NO syscalls. Reuses nx_writecraft for char classification (DRY).
license_tier: ORIGINAL
module: nishi-core.write.grammar
depends: nishi-core.write.craft
capability: WRITE_MECHANICAL_GRAMMAR
dependencies 1 imports · 1 importers
imports: nx_writecraft.nx
imported by: nx_grammar_gate.nx
structs
| none |
consts
| none |
functions
| 23 | func gr_is_art_vowel(c: i64) -> i64 |
| 34 | func gr_eq_lit(t: *u8, a: i64, b: i64, lit: *u8) -> i64 |
| 48 | func gr_words_eq(t: *u8, a1: i64, b1: i64, a2: i64, b2: i64) -> i64 |
| 58 | func gr_check(t: *u8, n: i64, out: *i64) -> i64 |