Thanks to visit codestin.com
Credit goes to github.com

Skip to content

One of two languages with same confidence value is erroneously removed #72

@mmedek

Description

@mmedek

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> {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions