mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-06 07:37:40 +00:00
docs(common/models): applies PR suggestion
Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
parent
1125b368f8
commit
9d35b26f1b
1 changed files with 11 additions and 0 deletions
|
|
@ -74,6 +74,17 @@ class ModelCompositor {
|
|||
if(!(transformDistribution instanceof Array)) {
|
||||
transformDistribution = [ {sample: transformDistribution, p: 1.0} ];
|
||||
} else if(transformDistribution.length == 0) {
|
||||
/*
|
||||
Robust stop-gap: if our other filters somehow fail, this fixes the
|
||||
zero-length array by making it match the form of the array that
|
||||
would result if it were instead called with the other legal
|
||||
parameter type - a single Transform.
|
||||
|
||||
Unfortunately, the method will lack all data about even
|
||||
the original keystroke that resulted in the call... but this way,
|
||||
we can at least get some predictions rather than shortcutting
|
||||
and producing none whatsoever.
|
||||
*/
|
||||
transformDistribution.push({
|
||||
sample: {
|
||||
insert: '',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue