code wiki / (root) / nx_content_measure.nx

nx_content_measure.nx

buildroot/runtime/nx_content_measure.nx

3025 B75 linesdepth 4pulls 4 transitivereach 2 importersview sourcekind librarytopic content
docsdependenciesstructsconstsfunctions

about

nx_content_measure.nx -- MEASURED content value (SREACH R3c-a). module: nishi-core.search.content_measure depends: fx.nx (Q16.16) capability: CORE_COMPUTE The operator's content-accessibility directive (engagement: media-heavy + information-dense pages), MEASURED from the fetched bytes instead of inferred from a facet label: a page earns its content score from what it actually serves. Two components, equal weight (the directive names BOTH "media sites" and "heavy information sites"): TEXT -- extracted-text length, bucketed (Rule #11 table; thresholds from the live corpus we crawl: JS shells ~10-300 chars, stubs ~1k, real articles 4k+) MEDIA -- <img/<video/<audio tag count in the HTML, bucketed (galleries 10+, illustrated pages 4-10, token imagery 1-3) score = (text_component + media_component) / 2, Q16.16 in [0,1]. KATs: nx_content_measure_test.nx. Replaces facet-INFERRED value at the live layer; the bench facet table stays for corpus-less scoring.

dependencies 1 imports · 2 importers

fx.nx nx_content_measure.nx nx_content_measure_test.nx nx_entity_discover.nx

imports: fx.nx

imported by: nx_content_measure_test.nxnx_entity_discover.nx

structs

none

consts

22const K_MAGIC_4000: i64 = 4000

functions

24func cm_lc(c: i64) -> i64 { if c >= 0x41 { if c <= 0x5A { return c + 0x20 } } return c }
called by 1: cm_count
27func cm_count(html: *u8, n: i64, needle: *u8) -> i64
called by 1: nx_content_media_count calls 1: cm_lc
45func nx_content_media_count(html: *u8, n: i64) -> i64
called by 1: nx_content_measure calls 1: cm_count
54func nx_content_text_component(textlen: i64) -> i64
called by 1: nx_content_measure calls 1: fx_from_frac
63func nx_content_media_component(media: i64) -> i64
called by 1: nx_content_measure calls 1: fx_from_frac
71func nx_content_measure(html: *u8, hlen: i64, textlen: i64) -> i64