Package com.yahoo.language.detect
Interface Detector
- All Known Implementing Classes:
AbstractDetector,SimpleDetector
public interface Detector
Abstract superclass of all Detectors used for language and encoding detection.
- Author:
- Einar M R Rosenvinge
-
Method Summary
Modifier and TypeMethodDescriptionDetects language and encoding of the supplied byte array, possibly using a language/encoding hint.Detects language of the supplied String, possibly using a language hint.detect(ByteBuffer input, Hint hint) Detects language and encoding of the supplied ByteBuffer, possibly using a language/encoding hint.
-
Method Details
-
detect
Detects language and encoding of the supplied byte array, possibly using a language/encoding hint.- Parameters:
input- the buffer that is to be inspectedoffset- the offset to detect fromlength- the size to detect fromhint- 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)
- Throws:
DetectionException- if detection fails
-
detect
Detects language and encoding of the supplied ByteBuffer, possibly using a language/encoding hint.- Parameters:
input- the buffer that is to be inspected, from its current position to its limithint- 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)
- Throws:
DetectionException- if detection fails
-
detect
Detects language of the supplied String, possibly using a language hint.- Parameters:
input- the string that is to be inspectedhint- 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)
- Throws:
DetectionException- if detection fails
-