Class Language

java.lang.Object
io.github.sergeloie.languagecheck.model.Language

public final class Language extends Object
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

      public String code()
      Language code (ISO 639-1 / BCP 47 subtag, e.g. "ru", "zh-Hans").
    • name

      public String name()
      Human-readable name (e.g. "Russian", "Chinese (Simplified)").
    • chars

      public List<UnicodeRange> 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 if codePoint is in any of this language's ranges.