code wiki / (root) / nx_postag_gate.nx

nx_postag_gate.nx

buildroot/runtime/nx_postag_gate.nx

7720 B95 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_postag_gate.nx -- GATE for the POS tagger (nx_postag), driven IN-PROCESS on a planted CoNLL-U mini-treebank under /tmp/nx_postag_gate. Proves: the CoNLL-U reader (comment lines skipped, a multiword range row skipped, a decimal empty-node row skipped, CRLF tolerated, forms lowercased), the tag table (all 17 UPOS names round-trip to their ids and an unknown tag reads -1), that the tagger LEARNS (a train where the same words carry the same tags is tagged perfectly at test), is deterministic, tags an arbitrary token stream through pt_tag_stream with the same answers, and that an untrained tagger is not a learned one (its accuracy on the same test is far below). Every fixture asserts its own condition first. No network. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_gatekit_lib.nx nx_reviewmine_lib.nx nx_postag.nx nx_gate_verdict.nx nx_postag_gate.nx

imports: nx_syscalls.nxnx_gatekit_lib.nxnx_reviewmine_lib.nxnx_postag.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gk_mkdir sys_mkdir gk_write sys_openat_wr gk_len gk_write_all sys_write ↻ sys_close gv_check gv_puts ↻ gk_exists sys_openat_rd sys_close ↻ gv_check_eq gv_check ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap

structs

none

consts

14const G_ROOT: *u8 = "/tmp/nx_postag_gate"
15const G_TRAIN: *u8 = "/tmp/nx_postag_gate/train.conllu"
16const G_TEST: *u8 = "/tmp/nx_postag_gate/test.conllu"
17const G_I64: i64 = 8
19const G_TRAIN_ROWS: *u8 = "# sent_id = 1\n1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tdog\tdog\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\t.\t.\tPUNCT\t.\t_\t3\tpunct\t_\t_\n\n# sent_id = 2\n1\tA\ta\tDET\tDT\t_\t2\tdet\t_\t_\r\n2\tcat\tcat\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n3-4\tdoesn't\t_\t_\t_\t_\t_\t_\t_\t_\n4\t.\t.\tPUNCT\t.\t_\t3\tpunct\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tbig\tbig\tADJ\tJJ\t_\t3\tamod\t_\t_\n2.1\tempty\t_\t_\t_\t_\t_\t_\t_\t_\n3\tdog\tdog\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t3\tdet\t_\t_\n2\tsmall\tsmall\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tcat\tcat\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tcat\tcat\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n"
23const G_TRAIN_SENTS: i64 = 5
24const G_TRAIN_TOKS: i64 = 21 // 4+4+5+5+3, the range row and the empty node excluded
26const G_TEST_ROWS: *u8 = "1\tThe\tthe\tDET\tDT\t_\t3\tdet\t_\t_\n2\tsmall\tsmall\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tdog\tdog\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t3\tdet\t_\t_\n2\tbig\tbig\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tcat\tcat\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n"
27const G_TEST_TOKS: i64 = 10
28const G_TEST_SENTS: i64 = 2
29const G_STREAM_TOKS: i64 = 3

functions

31func main() -> i64