/** * wikipedia-paraphrase.ts * * Loads the prebuilt Wikipedia trigram bloom filter and provides a * paraphrase-rate estimator. Used by content/wikipedia-paraphrase rule. * * v0.6.2 — bloom filter inlined as base64 to remove filesystem dependency. * Production hotfix: Vercel serverless deployments couldn't resolve the * relative file path. Inlining the 8 KB binary into the JS source removes * deployment-config dependencies and makes the rule work in any runtime * (Node, Bun, Cloudflare Workers, Vercel serverless, etc.). * * Bloom filter layout: * m = 65536 bits (8192 bytes) * k = 3 FNV-1a-32 hash functions with distinct seeds * * FP rate ~5% for the curated corpus of ~10 k unique trigrams. * * If the underlying corpus is regenerated via `bun run build-wikipedia-bloom`, * also re-run the inline script that produced BLOOM_BASE64 below — see * `scripts/inline-wikipedia-bloom.ts` (or regenerate manually): * node -e "console.log(require(node:fs).readFileSync(packages/core/data/wikipedia-trigrams.bin).toString(base64))" */ /** Decode and cache the bloom filter from the inlined base64 string. */ export declare function loadWikipediaBloomFilter(): Uint8Array; /** * Compute the paraphrase rate of `text` against the Wikipedia reference * corpus. Returns a value in [0, 1] — the fraction of trigrams that are * present in the bloom filter. Returns 0 for text shorter than 3 tokens. */ export declare function wikipediaParaphraseRate(text: string): number; /** Test-only: reset the bloom-filter cache so loadWikipediaBloomFilter * re-decodes the inlined base64 on next call. Used by unit tests. */ export declare function _resetBloomCache(): void; //# sourceMappingURL=wikipedia-paraphrase.d.ts.map