113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
function parseAndSpellcheck (sText, sLang, bDebug, bContext) {
let aGrammErr = gc_engine.parse(sText, sLang, bDebug, bContext);
let aSpellErr = oTokenizer.getSpellingErrors(sText, oDict);
return JSON.stringify({ aGrammErr: aGrammErr, aSpellErr: aSpellErr });
}
function getOptions () {
return gc_engine.getOptions()._toString();
}
function getDefaultOptions () {
return gc_engine.getDefaultOptions()._toString();
}
function setOptions (sGCOptions) {
gc_engine.setOptions(helpers.objectToMap(JSON.parse(sGCOptions)));
return gc_engine.getOptions()._toString();
}
function setOption (sOptName, bValue) {
gc_engine.setOptions(new Map([ [sOptName, bValue] ]));
return gc_engine.getOptions()._toString();
}
function resetOptions () {
gc_engine.resetOptions();
return gc_engine.getOptions()._toString();
}
function fullTests (sGCOptions='{"nbsp":true, "esp":true, "unit":true, "num":true}') {
if (!gc_engine || !oDict) {
return "# Error: grammar checker or dictionary not loaded."
}
let dMemoOptions = gc_engine.getOptions();
|
|
|
|
|
|
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
function parseAndSpellcheck (sText, sLang, bDebug, bContext) {
let aGrammErr = gc_engine.parse(sText, sLang, bDebug, bContext);
let aSpellErr = oTokenizer.getSpellingErrors(sText, oDict);
return JSON.stringify({ aGrammErr: aGrammErr, aSpellErr: aSpellErr });
}
function getOptions () {
return gc_engine.getOptions().gl_toString();
}
function getDefaultOptions () {
return gc_engine.getDefaultOptions().gl_toString();
}
function setOptions (sGCOptions) {
gc_engine.setOptions(helpers.objectToMap(JSON.parse(sGCOptions)));
return gc_engine.getOptions().gl_toString();
}
function setOption (sOptName, bValue) {
gc_engine.setOptions(new Map([ [sOptName, bValue] ]));
return gc_engine.getOptions().gl_toString();
}
function resetOptions () {
gc_engine.resetOptions();
return gc_engine.getOptions().gl_toString();
}
function fullTests (sGCOptions='{"nbsp":true, "esp":true, "unit":true, "num":true}') {
if (!gc_engine || !oDict) {
return "# Error: grammar checker or dictionary not loaded."
}
let dMemoOptions = gc_engine.getOptions();
|