Class CharacterChecker

java.lang.Object
io.github.sergeloie.languagecheck.check.CharacterChecker

public final class CharacterChecker extends Object
Scans the decoded text of one file against a CharPolicy.

Stateless: a single instance can check any number of files. Line counting is 1-based; only '\n' advances the line counter, so both LF and CRLF files report correct line numbers. '\r' itself is allowed ASCII and is skipped without advancing the line. Lone surrogates are reported as violations at their own code point value.

  • Constructor Details

    • CharacterChecker

      public CharacterChecker()
  • Method Details

    • check

      public CheckResult check(String text, CharPolicy policy, int maxSamples)
      Check text against policy.
      Parameters:
      maxSamples - maximum number of detailed Violations to collect (0 collects none; the total is still counted exactly)