code wiki / _hdl_build / _bm25_rank_authored.nx

_bm25_rank_authored.nx

buildroot/runtime/_hdl_build/_bm25_rank_authored.nx

908 B13 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic bm25
docsdependenciesstructsconstsfunctions

about

AUTHORED BY THE NISHI BUILDER (bm25-rank template) -- BM25 TF relevance, bits-up integer fixed-point

dependencies 1 imports · 0 importers

nx_syscalls.nx _bm25_rank_authored.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 bm25_rank bm25_tf_score bm25_tf_score ↻ sys_exit

structs

none

consts

none

functions

3func bm25_tf_score(tf: i64, doclen: i64, avgdl: i64) -> i64 { if avgdl<=0 { return 0 } let ratio: i64=(doclen*1000)/avgdl; let denom: i64=tf*1000+300+(900*ratio)/1000; if denom<=0 { return 0 } return (tf*22000000)/denom }
called by 2: bm25_rankmain
4func bm25_rank(tf0: i64, l0: i64, tf1: i64, l1: i64) -> i64 { let avgdl: i64=(l0+l1)/2; let s0: i64=bm25_tf_score(tf0,l0,avgdl); let s1: i64=bm25_tf_score(tf1,l1,avgdl); if s0>=s1 { return 0 } return 1 }
called by 1: main calls 1: bm25_tf_score
5func main() -> i64