detect method

String detect()

Detect language of the target text and return the language name which has the highest probability.

Implementation

String detect() {
  List<Language> probabilities = getProbabilities();
  if (probabilities.isNotEmpty) {
    return probabilities[0].lang;
  }
  return unknownLang;
}