detect static method

String detect(
  1. String text
)

Detect language of the input text and return Language code.

Implementation

static String detect(String text) {
  Detector detector = DetectorFactory().create();
  detector.append(text);
  return detector.detect();
}