decode method
Future<List<FutoSwipeCandidate> >
decode(
- Iterable<
FutoSwipePoint> trace, { - FutoSwipeLayout? layout,
- Iterable<
String> ? previousWords, - int maxCandidates = 3,
override
Ranks lexicon words for a swipe trace.
previousWords are the preceding words, oldest first; ContextLM reads
the last 16. Null disables ContextLM. An empty list scores the word as
the start of text. Each configuration uses its matching bundle weights.
Implementation
@override
Future<List<FutoSwipeCandidate>> decode(
Iterable<FutoSwipePoint> trace, {
FutoSwipeLayout? layout,
Iterable<String>? previousWords,
int maxCandidates = 3,
}) {
_ensureOpen();
final points = validatedFutoTrace(trace);
final words = previousWords == null
? null
: validatedFutoWords(previousWords, 'previousWords');
final count = validatedFutoCount(maxCandidates, 'maxCandidates');
final keys = layout ?? FutoSwipeLayout.englishQwerty();
return _enqueue(() => _manager.decode(points, keys, words, count));
}