Package org.apache.tika.language.detect
Class LanguageResult
- java.lang.Object
-
- org.apache.tika.language.detect.LanguageResult
-
public class LanguageResult extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static LanguageResult
NULL
-
Constructor Summary
Constructors Constructor Description LanguageResult(java.lang.String language, LanguageConfidence confidence, float rawScore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LanguageConfidence
getConfidence()
java.lang.String
getLanguage()
The ISO 639-1 language code (plus optional country code)float
getRawScore()
boolean
isLanguage(java.lang.String language)
Return true if the target language matches the detected language.boolean
isReasonablyCertain()
boolean
isUnknown()
java.lang.String
toString()
-
-
-
Field Detail
-
NULL
public static final LanguageResult NULL
-
-
Constructor Detail
-
LanguageResult
public LanguageResult(java.lang.String language, LanguageConfidence confidence, float rawScore)
- Parameters:
language
- ISO 639-1 language code (plus optional country code)rawScore
- confidence of detector in the result.
-
-
Method Detail
-
getLanguage
public java.lang.String getLanguage()
The ISO 639-1 language code (plus optional country code)- Returns:
- a string representation of the language code
-
getRawScore
public float getRawScore()
-
getConfidence
public LanguageConfidence getConfidence()
-
isReasonablyCertain
public boolean isReasonablyCertain()
-
isUnknown
public boolean isUnknown()
-
isLanguage
public boolean isLanguage(java.lang.String language)
Return true if the target language matches the detected language. We consider it a match if, for the precision requested or detected, it matches. This means: target | detected | match? zh | en | false zh | zh | true zh | zh-CN | true zh-CN | zh | true zh-CN | zh-TW | false zh-CN | zh-cn | true (case-insensitive)- Parameters:
language
-- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-