Class NonAsciiCharCounter

java.lang.Object
org.apache.tika.eval.core.textstats.NonAsciiCharCounter
All Implemented Interfaces:
StringStatsCalculator<Integer>, TextStatsCalculator

public class NonAsciiCharCounter extends Object implements StringStatsCalculator<Integer>
Counts non-ASCII characters (code units ≥ U+0080) in the extracted text.

Used as the denominator for the U+FFFD rate (see ReplacementCharCounter): decode failures only arise from high bytes, so FFFD as a fraction of non-ASCII chars is the un-diluted signal, whereas FFFD over total length collapses to ~0 on COMMON / ASCII-dominated documents. U+FFFD itself is ≥ 0x80, so it is included in this count, keeping the rate in [0, 100].