Class AbstractDetector

java.lang.Object
com.yahoo.language.detect.AbstractDetector
All Implemented Interfaces:
Detector

public abstract class AbstractDetector extends Object implements Detector
Author:
Simon Thoresen Hult
  • Constructor Details

    • AbstractDetector

      public AbstractDetector()
  • Method Details

    • detect

      public final 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)
    • detect

      public final 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)