public double getOOV(String txt) {
        List<TextStatsCalculator> calculators = new ArrayList<>();
        calculators.add(new CommonTokens());
        CompositeTextStatsCalculator calc = new CompositeTextStatsCalculator(calculators);
        Map<Class, Object> results = calc.calculate(txt);

        /*
            Note that the OOV requires language id, so you can also
            retrieve the detected languages with this:

            List<Language> detectedLanguages = (List<Language>) results.get(LanguageIDWrapper.class);

         */

        CommonTokenResult result = (CommonTokenResult) results.get(CommonTokens.class);
        return result.getOOV();
    }
Use the default language id models and the default common tokens
lists in tika-eval to calculate the out-of-vocabulary percentage
for a given string.

@param txt
@return
tika-example/src/main/java/org/apache/tika/example/TextStatsFromTikaEval.java