code wiki / _hdl_build / nx_stem.nx

nx_stem.nx

buildroot/runtime/_hdl_build/nx_stem.nx

14381 B368 linesdepth 2pulls 2 transitivereach 75 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_stem.nx -- SOVEREIGN morphological stemming: FULL Porter (1980), the estate's ONE stemmer. HISTORY: Step-1a-only -> PORTER-LITE 2026-07-03 (1a/1b/1c + a step-4 subset + -ly) -> FULL PORTER 2026-08-13 (all 5 steps, first-match-stops inside each step, the paper's suffix tables complete). The gate's own HONEST line named "fuller Porter steps" as the extension; the trigger was nx_beir_eval measuring our BM25 at nDCG@10 305 permil vs the stemmed Anserini baseline 320 -- its header named stemming as the gap. CONSUMERS (grep-verified 2026-08-13, coverage_complete=1): - nx_docportal_search_seg.nx: QUERY-TIME dictionary stem-expansion (both sides computed per query, nothing persisted -> a stemmer upgrade shifts conflation keys CONSISTENTLY; the change is DORMANT in the live daemon until its next rebuild -- RE-RUN THE MRR RULER on that rebuild). - nx_stem_gate.nx (R-UX-2): every pre-upgrade vector verified to hold under full Porter. - nx_beir_eval.nx: index+query tokenizer (the BEIR stemming rung). HONEST SCOPE: no irregulars (children->child needs a lexicon). Buffer contract: step 1b can APPEND one byte (-e restore) and nx_stem null-terminates, so out needs n+2 capacity. exports: nx_stem (buffered) + vr_stem (in-place, backward-compat) + pst_stem (in-place core). license_tier: ORIGINAL

dependencies 1 imports · 4 importers

nx_syscalls.nx nx_stem.nx nx_beir_eval.nx nx_docportal_search_seg.nx nx_stem_bound_gate.nx nx_stem_gate.nx

imports: nx_syscalls.nx

imported by: nx_beir_eval.nxnx_docportal_search_seg.nxnx_stem_bound_gate.nxnx_stem_gate.nx

structs

none

consts

none

functions

22func pst_cons(b: *u8, i: i64) -> i64
37func pst_m(b: *u8, j: i64) -> i64
52func pst_vowelin(b: *u8, j: i64) -> i64
called by 2: pst_step1bpst_step1c calls 1: pst_cons
57func pst_doublec(b: *u8, j: i64) -> i64
called by 2: pst_step1b2pst_step5b calls 1: pst_cons
63func pst_cvc(b: *u8, j: i64) -> i64
called by 2: pst_step1b2pst_step5a calls 1: pst_cons
75func pst_ends(b: *u8, k: i64, s: *u8, sl: i64) -> i64
81func pst_set(b: *u8, js: i64, s: *u8, sl: i64) -> i64
87func pst_step1a(b: *u8, k: i64) -> i64
called by 1: pst_stem calls 1: pst_ends
103func pst_step1b2(b: *u8, k: i64) -> i64
124func pst_step1b(b: *u8, k: i64) -> i64
145func pst_step1c(b: *u8, k: i64) -> i64
called by 1: pst_stem calls 2: pst_endspst_vowelin
151func pst_step2(b: *u8, k: i64) -> i64
called by 1: pst_stem calls 3: pst_endspst_mpst_set
234func pst_step3(b: *u8, k: i64) -> i64
called by 1: pst_stem calls 3: pst_endspst_mpst_set
262func pst_step4(b: *u8, k: i64) -> i64
called by 1: pst_stem calls 2: pst_endspst_m
329func pst_step5a(b: *u8, k: i64) -> i64
called by 1: pst_stem calls 2: pst_mpst_cvc
336func pst_step5b(b: *u8, k: i64) -> i64
called by 1: pst_stem calls 2: pst_doublecpst_m
343func pst_stem(b: *u8, n: i64) -> i64
358func nx_stem(inp: *u8, n0: i64, out: *u8) -> i64
called by 3: dss_stem_expandvr_stemmain calls 1: pst_stem
366func vr_stem(w: *u8, n: i64) -> i64
called by 2: st_casemain calls 1: nx_stem