dominantScript method
- String text
Cheap, script-only classification of text — does not run the n-gram
stage.
Returns a 4-letter ISO 15924 script code (e.g. "Latn", "Cyrl",
"Hani") for the most common script among the input's letter
codepoints, or null if the input has no scripted letters.
This always uses the built-in script table — it is not affected by a custom backend, since script classification is a fixed, deterministic Unicode property lookup, not a pluggable strategy.
Implementation
String? dominantScript(String text) => script_filter.dominantScript(text);