code wiki / (root) / nx_dr_extract.nx

nx_dr_extract.nx

buildroot/runtime/nx_dr_extract.nx

6291 B159 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic dr
docsdependenciesstructsconstsfunctions

about

nx_dr_extract.nx -- sovereign HTML -> main-text extractor (eats the "crude tag-strip" limit named on the published /research-scale scorecard). The old rig's sed 's/<[^>]*>/ /g' removed TAGS but kept <script>/<style> BODIES and HTML comments as judged text, and entity names tokenized as noise words (amp/nbsp/quot). This organ drops script/style/comment content, strips tags to a word separator, kills short &entities;, and squeezes whitespace -- so the judge sees prose, not JavaScript. nx_dr_extract <html_file> -> extracted text on stdout FAIL-LOUD: unreadable file => stderr marker + exit 1 (never a silent empty extraction). Deterministic by construction (pure byte scan). An unterminated <script> eats the remainder (rare, malformed HTML) -- deterministic fail-safe, never a crash. Every func <=6 params (NAS nx_cc >6-arg skew, seq239). No hardware writes (Rule 26). license_tier: ORIGINAL expect_exit: 0 module: nishi-core.research.dr_extract depends: nx_syscalls.nx

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_dr_extract.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ex_err sys_write sys_exit sys_mmap ex_readfile sys_openat_rd sys_read sys_close ex_skipcomment ex_matchname ex_lc ex_alnum ex_skipblock ex_matchname ↻ ex_entend ex_alnum ↻ sys_write ↻

structs

none

consts

15const K_MAGIC_262144: i64 = 262144
17const K_IN: i64 = 4194304

functions

19func ex_alnum(c: i64) -> i64
26func ex_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
called by 1: ex_matchname
30func ex_matchname(buf: *u8, i: i64, len: i64, name: *u8, nlen: i64) -> i64
called by 2: ex_skipblockmain calls 2: ex_lcex_alnum
44func ex_skipblock(buf: *u8, i: i64, len: i64, name: *u8, nlen: i64) -> i64
called by 1: main calls 1: ex_matchname
70func ex_skipcomment(buf: *u8, i: i64, len: i64) -> i64
called by 1: main
82func ex_entend(buf: *u8, i: i64, len: i64) -> i64
called by 1: main calls 1: ex_alnum
98func ex_readfile(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
116func ex_err(msg: *u8) -> i64 { var n: i64 = 0; while msg[n] != (0 as u8) { n = n + 1 } sys_write(2, msg, n); return 0 }
called by 1: main calls 1: sys_write
118func main(argc: i64, argv: *i64) -> i64