Class Language
java.lang.Object
io.github.sergeloie.languagecheck.model.Language
A human language with its Unicode code-point alphabet.
Instances are immutable and eagerly resolved: the chars JSON
shape is parsed in of(String, String, Chars) and validated
right there, so a malformed file fails with a clear message at load time
instead of deep inside the check.
A language whose chars is absent or empty (e.g. en,
id) is valid - it signifies that ASCII (< 0x80) is the
only non-formatting contribution of this language.
-
Method Details
-
code
Language code (ISO 639-1 / BCP 47 subtag, e.g."ru","zh-Hans"). -
name
Human-readable name (e.g. "Russian", "Chinese (Simplified)"). -
chars
Non-ASCII code-point ranges that define this language's alphabet. May be empty (e.g. English, Indonesian). -
contains
public boolean contains(int codePoint) True ifcodePointis in any of this language's ranges.
-