Skip to content

Commit

Permalink
fix(all): Spelled now received first letter in uppercase.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Oct 30, 2020
1 parent 41f0496 commit b1359bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
4 changes: 3 additions & 1 deletion packages/kb.gbapp/dialogs/AskDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -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}`);
Expand Down
1 change: 1 addition & 0 deletions packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b1359bb

Please sign in to comment.