detectLangs static method
Detect language of the input text and return Language codes and probabilities.
Implementation
static List<Language> detectLangs(String text) {
Detector detector = DetectorFactory().create();
detector.append(text);
return detector.getProbabilities();
}