nx_dr_extract.nx
buildroot/runtime/nx_dr_extract.nx
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
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
structs
| none |
consts
| 15 | const K_MAGIC_262144: i64 = 262144 |
| 17 | const K_IN: i64 = 4194304 |
functions
| 19 | func ex_alnum(c: i64) -> i64 |
| 26 | func ex_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: ex_matchname |
| 30 | func ex_matchname(buf: *u8, i: i64, len: i64, name: *u8, nlen: i64) -> i64 |
| 44 | func ex_skipblock(buf: *u8, i: i64, len: i64, name: *u8, nlen: i64) -> i64 |
| 70 | func ex_skipcomment(buf: *u8, i: i64, len: i64) -> i64 called by 1: main |
| 82 | func ex_entend(buf: *u8, i: i64, len: i64) -> i64 |
| 98 | func ex_readfile(path: *u8, buf: *u8, cap: i64) -> i64 |
| 116 | func 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 } |
| 118 | func main(argc: i64, argv: *i64) -> i64 |