Package com.yahoo.language.opennlp
Class OptimaizeDetector
- java.lang.Object
-
- com.yahoo.language.opennlp.OptimaizeDetector
-
-
Constructor Summary
Constructors Constructor Description OptimaizeDetector()
-
Method Summary
All Methods Instance Methods Concrete 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(String input, Hint hint)
Detects language of the supplied String, possibly using a language hint.Detection
detect(ByteBuffer input, Hint hint)
Detects language and encoding of the supplied ByteBuffer, possibly using a language/encoding hint.Language
guessLanguage(String input)
-
-
-
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 interfaceDetector
- 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)
-
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 interfaceDetector
- 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)
-
detect
public Detection detect(String input, Hint hint)
Description copied from interface:Detector
Detects language of the supplied String, possibly using a language hint.
-
-