LanguageDetector class
Predicts the language of an input text.
Usage:
final options = LanguageDetectorOptions(); // optional parameters
final detector = LanguageDetector(options);
final result = await detector.detect('¿Como estas?')
print(result.predictions.first.languageCode);
> "es"
detector.dispose();
- Inheritance
-
- Object
- BaseLanguageDetector
- LanguageDetector
Constructors
- LanguageDetector(LanguageDetectorOptions options)
- Predicts the language of an input text.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
detect(
String text) → Future< LanguageDetectorResult> -
Sends a String value to MediaPipe for language detection.
override
-
dispose(
) → void -
Cleans up all resources.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited