Package com.yahoo.language.detect
Interface Detector
-
- All Known Implementing Classes:
AbstractDetector
public interface Detector
Abstract superclass of all Detectors used for language and encoding detection.- Author:
- Einar M R Rosenvinge
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Detection
detect(byte[] input, int offset, int length, Hint hint)
Detects language and encoding of the supplied byte array, possibly using a language/encoding hint.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.
-
-
-
Method Detail
-
detect
Detection detect(byte[] input, int offset, int length, Hint hint)
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
Detection detect(java.nio.ByteBuffer input, Hint hint)
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
Detection detect(java.lang.String input, Hint hint)
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
-
-