nx_writestyle.nx
buildroot/runtime/nx_writestyle.nx
about
nx_writestyle.nx -- WRITING arc, rung W-R1: the content-agnostic prose-SIGNAL
detector. Extends W-R0 (nx_writecraft) with the craft signals an editor flags,
computed deterministically so they are exact + reproducible + exceed-able vs
Hemingway Editor / ProWritingAid (highlights -> here, quantitative counts).
CONTENT-AGNOSTIC by design: it scores any register (the SFW lane and the
operator's local-LLM explicit lane run the SAME organ). The dialogue ratio +
these signals also feed the register classifier / routing seam and the
companion + image-gen ingestion point (per the 2026-06-12 fiction-ingestion
spec). No register lexicon lives here -- that arrives later as DATA (rule 25),
operator/lane-provided, never hardcoded.
Signals (out[], filled by ws_signals):
out[0] = adverbs -- words ending "-ly" (len >= WS_ADVERB_MINLEN)
out[1] = passive -- a be-verb followed within WS_PASS_WINDOW words
by an "-ed" word (one per be-verb)
out[2] = weak -- intensifier/filler words (data list below)
out[3] = dialogue_milli -- chars inside double-quotes * 1000 / total chars
out[4] = longest_sentence -- words in the longest sentence
out[5] = hard_sentences -- sentences with >= WS_HARD_SENT_WORDS words
out[6], out[7] -- SCRATCH (be-verb window, current-sentence words)
-- caller must allocate out with >= 8 i64.
returns out[0] (adverb count).
A word can satisfy more than one signal ("really" = adverb AND weak); that is
intentional. Thresholds are heuristic consts (move to conf/store as DATA next).
Pure integer, NO syscalls. Reuses nx_writecraft for char classification (DRY).
license_tier: ORIGINAL
module: nishi-core.write.style
depends: nishi-core.write.craft
capability: WRITE_PROSE_SIGNALS
dependencies 1 imports · 4 importers
imports: nx_writecraft.nx
imported by: nx_tone.nxnx_write_exceed_gate.nxnx_writehub_score.nxnx_writestyle_gate.nx
structs
| none |
consts
| 36 | const WS_ADVERB_MINLEN: i64 = 4 |
| 37 | const WS_PASS_WINDOW: i64 = 3 |
| 38 | const WS_HARD_SENT_WORDS: i64 = 14 |
functions
| 41 | func ws_streq_ci(t: *u8, a: i64, b: i64, lit: *u8) -> i64 |
| 55 | func ws_ends2(t: *u8, a: i64, b: i64, c1: i64, c2: i64) -> i64 |
| 62 | func ws_is_beverb(t: *u8, a: i64, b: i64) -> i64 |
| 74 | func ws_is_weak(t: *u8, a: i64, b: i64) -> i64 |
| 88 | func ws_eval_word(t: *u8, a: i64, b: i64, out: *i64) -> i64 |
| 107 | func ws_signals(t: *u8, n: i64, out: *i64) -> i64 |