Class ReplacementCharCounter

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

public class ReplacementCharCounter extends Object implements StringStatsCalculator<Integer>
Counts U+FFFD (REPLACEMENT CHARACTER) occurrences in the extracted text.

A high replacement-char count signals a decode failure — the charset used to decode the bytes couldn't map them, producing U+FFFD. Unlike OOV, this is a structural correctness signal that does not depend on the per-language vocabulary, so it does not mis-rank CJK decodes (real CJK is OOV-heavy but has zero U+FFFD; mojibake under the wrong charset has many).