Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cortex/blob/main/tests/fts/t_tok.om # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / tests / fts / t_tok.om` 72 lines ยท 1171 bytes Raw Blame History 1 note ===== tests/fts/t_tok.om : tokenizer differential harness ===== 2 note usage: t_tok DUMP > out ; prints " c( ::)*" per column, 3 note the same format as `oracle tok` (which calls SQLite's own unicode61 xTokenize) 4 global tmd uchar 8 5 fn main to int 6 uf_init 7 fd = t_open 1 8 if gt argcnt 2 9 ret t_recs fd 10 end 11 z = t_need fd 12 12 put tibp 0 8 13 nf = t_u32 14 for r ulong nf 15 z = t_need fd 8 16 row = t_u64 17 b = t_rdsb fd 18 t_rdnm fd 19 t_rdct fd 20 b = t_rdsb fd 21 b = t_rdsb fd 22 z = t_need fd 1 23 put tibp 0 add get tibp 0 1 24 t_tline row 1 1 get qnml 0 25 t_tline row 2 0 get qctl 0 26 end 27 t_flush 28 ret 0 29 end 30 fn t_tline row ulong col ulong src ulong n ulong to void 31 t_dec row 32 t_ch 32 33 t_ch 99 34 t_dec col 35 uf_start src n 36 for k ulong 17 37 dn = false 38 for j ulong 999999 39 if not uf_next 40 dn = true 41 break 42 end 43 t_ch 32 44 t_dec get qtis 0 45 t_ch 58 46 t_dec get qtie 0 47 t_ch 58 48 m = get qtfn 0 49 if gt m 32768 50 m = ulong 32768 51 end 52 for i ulong m 53 t_hex ulong get qtf i 2 54 end 55 end 56 if dn 57 break 58 end 59 end 60 t_ch 10 61 end 62 note records mode: u32 length + bytes, tokenized from qct 63 fn t_recs fd int to int 64 r = ulong 0 65 while t_need fd 4 bound 999999 66 t_rdct fd 67 t_tline r 2 0 get qctl 0 68 r = add r 1 69 end 70 t_flush 71 ret 0 72 end