DetectorFactory class

Language Detector Factory Class. This class manages an initialization and constructions of Detector. Before using language detection library, initialize just once with initFactory() method after WidgetsFlutterBinding.ensureInitialized();

When the language detection, construct Detector instance via DetectorFactory.create(). See also Detector's sample code.

Constructors

DetectorFactory()
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
langList ↔ List<String>
getter/setter pair
logger → Logger
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
seed ↔ int?
getter/setter pair
wordLangProbMap ↔ Map<String, List<double>>
getter/setter pair

Methods

addProfile(LangProfile profile, int index, int langSize) → void
clear() → void
create({double? alpha}) → Detector
getLangList() → List<String>
loadJsonProfile(List<String> jsonProfiles) → void
loadProfile() → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setSeed(int seed) → void
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

profileBasePath ↔ String
getter/setter pair

Static Methods

detect(String text) → String
Detect language of the input text and return Language code.
detectLangs(String text) → List<Language>
Detect language of the input text and return Language codes and probabilities.
initFactory() → Future<void>