@@ -528,6 +528,14 @@ class MyScriptTextWeb extends PolymerElement {
528
528
value : [ ] ,
529
529
reflectToAttribute : true
530
530
} ,
531
+ /**
532
+ * custom lexicon
533
+ */
534
+ customlexicon : {
535
+ type : Array ,
536
+ value : [ ] ,
537
+ reflectToAttribute : true
538
+ } ,
531
539
/**
532
540
* If set to true, hide the export panel.
533
541
*/
@@ -759,7 +767,7 @@ class MyScriptTextWeb extends PolymerElement {
759
767
return stylesheet ;
760
768
}
761
769
762
- static _generateTextConfiguration ( configuration , language , mimetypes , alwaysconnected , disableguides , disablesmartguide , enablesmartguidefadeout , smartguidefadeoutduration , nolktext , customresources , textinputmode , resultdetail , contenttypes , subsetknowledges , userlkwords , userresources , textcandidatelistsize , wordcandidatelistsize , wordpredictionlistsize , wordcompletionlistsize , charactercandidatelistsize , enableoutoflexicon , discardcasevariations , discardaccentuationvariations , glyphdistortion , enabletagger , spellingdistortion ) {
770
+ static _generateTextConfiguration ( configuration , language , mimetypes , alwaysconnected , disableguides , disablesmartguide , enablesmartguidefadeout , smartguidefadeoutduration , nolktext , customresources , customlexicon , textinputmode , resultdetail , contenttypes , subsetknowledges , userlkwords , userresources , textcandidatelistsize , wordcandidatelistsize , wordpredictionlistsize , wordcompletionlistsize , charactercandidatelistsize , enableoutoflexicon , discardcasevariations , discardaccentuationvariations , glyphdistortion , enabletagger , spellingdistortion ) {
763
771
// FIXME: find a way to do a proper deep merge
764
772
const conf = Object . assign ( { } , configuration ) ;
765
773
if ( ! conf . recognitionParams ) {
@@ -813,7 +821,12 @@ class MyScriptTextWeb extends PolymerElement {
813
821
}
814
822
if ( customresources ) {
815
823
conf . recognitionParams . v4 . text . configuration . customResources = customresources ;
816
- conf . recognitionParams . v4 . text . configuration . addLKText = ! nolktext ;
824
+ }
825
+ if ( customlexicon ) {
826
+ conf . recognitionParams . v4 . text . configuration . customLexicon = customlexicon ;
827
+ }
828
+ if ( customresources || customlexicon ) {
829
+ conf . recognitionParams . v4 . text . configuration . addLKText = ! nolktext ;
817
830
}
818
831
if ( textinputmode ) {
819
832
conf . recognitionParams . v3 . textParameter . textInputMode = textinputmode ;
@@ -888,6 +901,7 @@ class MyScriptTextWeb extends PolymerElement {
888
901
this . smartguidefadeoutduration ,
889
902
this . nolktext ,
890
903
this . customresources ,
904
+ this . customlexicon ,
891
905
this . textinputmode ,
892
906
this . resultdetail ,
893
907
this . contenttypes ,
0 commit comments