org.codelibs.elasticsearch.langfield.detect.Language Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-langfield Show documentation
Show all versions of elasticsearch-langfield Show documentation
This plugin provides b-bit langfield algorism.
package org.codelibs.elasticsearch.langfield.detect;
import java.util.ArrayList;
/**
* {@link Language} is to store the detected language.
* {@link LangDetector#getProbabilities()} returns an {@link ArrayList} of {@link Language}s.
*
* @see LangDetector#getProbabilities()
* @author Nakatani Shuyo
*
*/
public class Language {
public String lang;
public double prob;
public Language(final String lang, final double prob) {
this.lang = lang;
this.prob = prob;
}
@Override
public String toString() {
if (lang == null) {
return "";
}
return lang + ":" + prob;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy