code wiki / (root) / nx_doc_extract.nx

nx_doc_extract.nx

buildroot/runtime/nx_doc_extract.nx

6296 B155 linesdepth 2pulls 2 transitivereach 13 importersview sourcekind librarytopic doc
docsdependenciesstructsconstsfunctions

about

nx_doc_extract.nx -- R1 of THE NISHI DOCUMENT-INTELLIGENCE arc: READ a document's text into STRUCTURED DATA. The "consuming documents -> structured data" leg (the other leg, making documents, is nx_fin_dispute / the emitters). Sovereign + deterministic: a tolerant line/field parser (no OCR/ML dependency) that turns an itemized medical-bill statement into structured line-items (date, CPT code, units, billed cents) that flow straight into nx_fin_audit -- so a scanned/typed bill becomes auditable structured data with ZERO manual entry. This is the format-specific deterministic rung; the research corpus (knowledge/fetched/ doc_*.raw: layout-analysis, IE, NER, classification) grounds the roadmap to arbitrary-layout + classified extraction. A line is a line-item iff it begins with a MM/DD/YYYY date AND carries a 5-digit code AND a $amount; headers/totals/blank lines are skipped by construction. No floats (exact cents), no hardware writes. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_doc_extract.nx nx_climbout_docs.nx nx_doc_classify_gate.nx nx_doc_extract_gate.nx

imports: nx_syscalls.nx

imported by: nx_climbout_docs.nxnx_doc_classify_gate.nxnx_doc_extract_gate.nx

structs

none

consts

none

functions

14func dx_dig(c: i64) -> i64
21func dx_tok_date(line: *u8, s: i64, l: i64) -> i64
called by 1: dx_extract_bill calls 1: dx_dig
44func dx_tok_int(line: *u8, s: i64, l: i64) -> i64
called by 1: dx_extract_bill calls 1: dx_dig
58func dx_is5(line: *u8, s: i64, l: i64) -> i64
called by 1: dx_extract_bill calls 1: dx_dig
66func dx_tok_money(line: *u8, s: i64, l: i64) -> i64
called by 1: dx_extract_bill calls 1: dx_dig
95func dx_tokenize(line: *u8, lstart: i64, llen: i64, tstart: *i64, tlen: *i64, cap: i64) -> i64
called by 1: dx_extract_bill
117func dx_extract_bill(text: *u8, n: i64, out_codes: *i64, out_dates: *i64, out_units: *i64, out_billed: *i64, cap: i64) -> i64