LanguageGuess class
Result of a language detection: the language code and a score.
The score is a normalized distance in [0, 1] where lower is a closer
match; confidence is its complement so a bigger number means more sure.
Kept as an immutable value object so results are safe to cache and compare.
Example:
const r = LanguageGuess('en', 0.2);
print(r.confidence); // 0.8
Constructors
- LanguageGuess(String language, double score)
-
Creates an immutable guess from a
languagecode and distancescore. Audited: 2026-06-12 11:26 EDTconst
Properties
- confidence → double
-
Convenience inverse of score: higher means a more confident guess.
Audited: 2026-06-12 11:26 EDT
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- language → String
-
ISO-639-1 style code of the best-matching profile (e.g.
'en').final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- score → double
-
Normalized out-of-place distance in
[0, 1]; lower means a closer match.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override