meow-memorizing

wasm-matcher

WebAssembly backend for the page word scanner. Replaces the JS O(text × words) indexOf loop with a single-pass Aho-Corasick scan.

Responsibility

DOM traversal and rendering stay in JS; this crate is pure text computation.

Boundary

#[wasm_bindgen] exports (see src/lib.rs):

Match semantics: leftmost-longest, non-overlapping, ASCII case-insensitive, both flanks non-[a-zA-Z]. Returned word preserves the source casing.

Build

cargo test -p wasm-matcher runs native unit tests. Browser artifacts are produced by scripts/build-wasm.sh (wasm32 release + wasm-bindgen) and inlined as base64 by scripts/inline-wasm.ts. See repo AGENTS.md.