fix(all): Spelled now received first letter in uppercase.

This commit is contained in:
Rodrigo Rodriguez 2020-10-30 11:30:03 -03:00
parent 41f04965d4
commit b1359bbf09
3 changed files with 5 additions and 1 deletions

View file

@ -770,6 +770,7 @@ export class GBMinService {
const key = min.instance.spellcheckerKey ? min.instance.spellcheckerKey : min.instance.spellcheckerKey;
if (key) {
text = text.charAt(0).toUpperCase() + text.slice(1);
const data = await AzureText.getSpelledText(min.instance.spellcheckerKey, text);
if (data !== text) {
GBLog.info(`Spelling corrected: ${data}`);

View file

@ -132,9 +132,10 @@ export class AskDialog extends IGBDialog {
const member = step.context.activity.from;
// Spells check the input text before translating.
text = text.charAt(0).toUpperCase() + text.slice(1);
const key = min.instance.spellcheckerKey ? min.instance.spellcheckerKey : min.instance.spellcheckerKey;
if (key) {
const data = await AzureText.getSpelledText(min.instance.spellcheckerKey, text);
if (data !== text) {
GBLog.info(`Spelling corrected (3): ${data}`);
@ -199,6 +200,7 @@ export class AskDialog extends IGBDialog {
const key = min.instance.spellcheckerKey ? minBoot.instance.spellcheckerKey : min.instance.spellcheckerKey;
if (key) {
text = text.charAt(0).toUpperCase() + text.slice(1);
const data = await AzureText.getSpelledText(min.instance.spellcheckerKey, text);
if (data !== text) {
GBLog.info(`Spelling corrected: ${data}`);

View file

@ -183,6 +183,7 @@ export class KBService implements IGBKBService {
query = query.replace('.', ' ');
query = query.replace('/', ' ');
query = query.replace('\\', ' ');
query = query.replace('\r\n', ' ');
if (subjects !== null) {
const text = KBService.getSubjectItemsSeparatedBySpaces(subjects);