There is a potential bug in the computeLanguageConfidenceValues method in LanguageDetector class when the same confidence is computed.
The return value SortedMap<Language, Double> uses comparator by prob-value, this means that when any two languages have the same probability then only one of them could remain in the map. So for example, when the original distribution is cs=0.4, de=0.4, en=0.2 then this method will return only de=0.4, en=0.2.
|
fun computeLanguageConfidenceValues(text: String): SortedMap<Language, Double> { |