code wiki / (root) / nx_noun_phrase_scan.nx

nx_noun_phrase_scan.nx

buildroot/runtime/nx_noun_phrase_scan.nx

14810 B360 linesdepth 3pulls 4 transitivereach 7 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_noun_phrase_scan.nx -- bounded heuristic noun-phrase discovery. Walks a source byte region looking for STRUCTURAL English cues (determiners + key verbs + prepositions) that precede a noun phrase, then captures the next 1-4 token span as a candidate. Cues are GRAMMATICAL not TOPICAL: "wearing", "in the", "at the", "her", "his" -- not "apron" / "kitchen" / "bedroom". The actual vocabulary is discovered from what follows the cues. Output: caller-allocated array of PhraseCandidate records. The term registry observes each candidate and grows the open vocabulary. No closed-set dictionary anywhere in the pipeline. Per cardinals: feedback-loras-and-negatives-are-patches: structural cues, not topical lexicons -- the substrate measures statistical co-occurrence rather than memorizing seed lists. feedback-self-surfacing-intelligence: scanner emits CANDIDATES with confidence; registry grades them through STAGE1/2/3 over time. feedback-bounded-loop-discipline-jpl-rule-2: every loop carries explicit BUDGET ceiling. nx_safety_envelope: intended_use: "Surface noun-phrase candidates from a beat's source byte range using grammatical-cue heuristics, with role-hint + confidence." sil_target: SIL2 asil_target: QM dal_target: DAL C iec_62304_class: NONE evidence: [no_floating_point, no_closed_topical_dictionary, bounded_outer_and_inner_loops, out_array_capacity_respected] hazard_register: [bug-tape-cue-pattern-false-positive, bug-tape-phrase-span-overruns-sentence] residual_risk: "Structural-only English cues today; non- English text gets fewer candidates emitted

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_term_registry.nx nx_phrase_match.nx nx_noun_phrase_scan.nx nx_term_extract.nx nx_term_extract_test.nx

imports: nx_syscalls.nxnx_term_registry.nxnx_phrase_match.nx

imported by: nx_term_extract.nxnx_term_extract_test.nx

structs

53struct PhraseCandidate

consts

60const NX_NP_CAND_BYTES: i64 = 32
79const NX_NP_CUE_COUNT: i64 = 18
144const NX_NP_MAX_TOKEN_LEN: i64 = 48

functions

81func nx_np_cue_at(idx: i64,
called by 1: nx_noun_phrase_scan
115func nx_np_is_terminator(c: i64) -> i64
129func nx_np_load_u8(p: *u8, i: i64) -> i64
146func nx_np_is_stop_at_start(src: *u8, s: i64, e: i64) -> i64
178func nx_np_skip_ws(src: *u8, p: i64, region_end: i64) -> i64
called by 1: nx_np_capture_span calls 1: nx_np_load_u8
202func nx_np_read_token(src: *u8, p: i64, region_end: i64) -> i64
226func nx_np_capture_span(src: *u8, after_cue: i64, region_end: i64,
272func nx_noun_phrase_scan(src: *u8, region_start: i64, region_end: i64,