@Override
    public Detection detect(byte[] input, int offset, int length, Hint hint) {
        Charset encoding = Charset.forName(simple.guessEncoding(input, offset, length));
        return new Detection(detectLanguage(new String(input, offset, length, encoding)), encoding.name(), false);
    }
Detects text language using patched OpenNLP, with fallback to {@link SimpleDetector} for undetected CJK input.

@author jonmv
opennlp-linguistics/src/main/java/com/yahoo/language/opennlp/OpenNlpDetector.java