Package com.optimaize.langdetect
Class DetectedLanguage
java.lang.Object
com.optimaize.langdetect.DetectedLanguage
- All Implemented Interfaces:
Comparable<DetectedLanguage>
Holds information about a detected language: the locale (language) and the probability.
Comparable: the "better" one comes before the worse. First order by probability descending (1 to 0). Then order by language ascending (a to z).
This class is immutable.
-
Field Details
-
locale
-
probability
private final double probability
-
-
Constructor Details
-
DetectedLanguage
- Parameters:
locale
-probability
- 0-1
-
-
Method Details
-
getLocale
-
getProbability
public double getProbability()- Returns:
- 0-1, the higher the better.
-
toString
-
compareTo
See class header.- Specified by:
compareTo
in interfaceComparable<DetectedLanguage>
-