Browser requirements
- … WebAssembly
- … ES modules
- … Reading local files (
Blob.arrayBuffer) - … Strict UTF-8 decoding (
TextDecoder)
No storage, no network: this page keeps nothing and sends nothing after it has loaded. Without the two file features you can still paste text.
What this demo does not do yet
- Devanagari only: Tamil planned for v0.2 (a design note exists; nothing is implemented), Bengali later. Text in any other script is treated as plain text, so a Latin line scores clean in the Report tab, and the Gate tab marks it not scored: passed through, never held.
-
Structural checks only: it cannot see visually plausible OCR confusions (
बforव), a well-formed but wrong word, or legacy-font text that was read back as Latin letters. A pass means no structural damage above the threshold was found, not that the text is correct. - The rule weights and the gate's default threshold (975000) are not calibrated on real documents: they come from how badly each defect breaks rendering or reading and from a benchmark on synthetic text only. Nothing here says how good a Hindi answer built on gated text would be.
- UTF-8 text only, at most 1 MiB: no PDF, no OCR, no other encodings.
- No service worker: offline after the first load is best effort (Chrome's HTTP cache), not guaranteed.
- Nothing is published yet: the Python wheel and the npm package were built and installed locally on macOS arm64 only, and are on no registry. CI built Linux and Windows wheels and an sdist (run 43667702791), but those are workflow artifacts, not releases.
- No figure on this page was measured on an 8 GB laptop: not measured on 8 GB.
The WASM module could not load
Text
Paste Devanagari or Hindi text, drop a .txt file on the box below, choose one with the
file picker, or load a synthetic sample. Samples are made up; none is a real document.
Drop a plain-text file here, or choose one
The file is read in this tab only: UTF-8 text up to 1 MiB, never uploaded. A file that is not valid UTF-8, or is over 1 MiB, is refused before anything is validated.
0 of 1,048,576 bytes
Document score
Each flagged cluster costs the largest weight among its issues; the score is 1 − penalty × 1000 ÷ clusters, in parts per million, shown with four decimals (truncated, never rounded) by integer arithmetic. 1.0000 is clean; empty text scores 1.0000.
Heatmap
One row per line: a strip for the line, then every grapheme cluster of the line. A cluster is
shaded by the sum of the weights of the rules that fired on it; the strip uses the same sum over the
whole line. Hover a shaded cluster to see the rules. Invisible, control and private-use code points
are shown as ⟨U+XXXX⟩.
- clean: no rule fired
- low: weight sum 1 to 399
- mid: 400 to 799
- high: 800 and above
The sixteen rules
The stable wire names from issue_kinds(), each with its weight from
weights/devanagari.toml and how many times it fired on this text.
Lines
One row per line (LF, CRLF or a bare CR ends a line). The score is the same formula applied
to that line alone. Invisible or private-use code points are shown as ⟨U+XXXX⟩.
| Line | Text | Clusters | Flagged | Score | Issues |
|---|
Grapheme clusters
UAX #29 extended grapheme clusters the validator judged, with byte offsets into the UTF-8 input. Flagged clusters name the rules that fired.
| # | Cluster | Code points | Bytes | Rules |
|---|
Canonical JSON report
Exactly what validate() returned, which is byte for byte what
glyphsift check - prints for the same text.
Module
- Report spec
…- Module id
…(first 16 hex of sha256 over glyphsift.js + glyphsift_bg.wasm)- validate() calls
0(a refused input is not counted: the validator is not run for it)
Gate
One answer per chunk of extracted text. Pass: a Devanagari chunk whose score is at or above the threshold. Hold: a Devanagari chunk below it, probably garbled by extraction, so a pipeline would keep it out of its index and say so. Not scored: text that is not mostly Devanagari (under 500000 ppm of its letters, or no letters at all) is passed through unjudged; it is never held. The default threshold is 975000 ppm, derived from the benchmark in docs/gate.md; the field below changes it.
Verdict: —
Gate JSON
Exactly what gate() returned, which is byte for byte what glyphsift gate - prints for the
same text and threshold.
gate() calls: 0
(a refused input or threshold is not counted: the gate is not run for it)