Class OptimaizeDetector

  • All Implemented Interfaces:
    Detector

    public class OptimaizeDetector
    extends Object
    implements Detector
    Detects the language of some sample text using SimpleDetector for CJK and Optimaize otherwise.
    Author:
    bratseth
    • Constructor Detail

      • OptimaizeDetector

        public OptimaizeDetector()
    • Method Detail

      • detect

        public Detection detect​(byte[] input,
                                int offset,
                                int length,
                                Hint hint)
        Description copied from interface: Detector
        Detects language and encoding of the supplied byte array, possibly using a language/encoding hint.
        Specified by:
        detect in interface Detector
        Parameters:
        input - the buffer that is to be inspected
        offset - the offset to detect from
        length - the size to detect from
        hint - a hint to the detector, or null for no hint
        Returns:
        an array of possible language/encoding pairs, sorted by decreasing confidence (possibly empty, but never null)
      • detect

        public Detection detect​(ByteBuffer input,
                                Hint hint)
        Description copied from interface: Detector
        Detects language and encoding of the supplied ByteBuffer, possibly using a language/encoding hint.
        Specified by:
        detect in interface Detector
        Parameters:
        input - the buffer that is to be inspected, from its current position to its limit
        hint - a hint to the detector, or null for no hint
        Returns:
        an array of possible language/encoding pairs, sorted by decreasing confidence (possibly empty, but never null)
      • detect

        public Detection detect​(String input,
                                Hint hint)
        Description copied from interface: Detector
        Detects language of the supplied String, possibly using a language hint.
        Specified by:
        detect in interface Detector
        Parameters:
        input - the string that is to be inspected
        hint - a hint to the detector, or null for no hint
        Returns:
        an array of possible language/encoding pairs, sorted by decreasing confidence (possibly empty, but never null)