Class AbstractDetector

  • All Implemented Interfaces:
    Detector

    public abstract class AbstractDetector
    extends java.lang.Object
    implements Detector
    Author:
    Simon Thoresen Hult
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Detection detect​(java.lang.String input, Hint hint)
      Detects language of the supplied String, possibly using a language hint.
      Detection detect​(java.nio.ByteBuffer input, Hint hint)
      Detects language and encoding of the supplied ByteBuffer, possibly using a language/encoding hint.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.yahoo.language.detect.Detector

        detect
    • Constructor Detail

      • AbstractDetector

        public AbstractDetector()
    • Method Detail

      • detect

        public final Detection detect​(java.lang.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)
      • detect

        public final Detection detect​(java.nio.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)