new(all): Additional interfaces for text processing in .gbapp.
This commit is contained in:
parent
9b94b08167
commit
06f155ba94
3 changed files with 37 additions and 33 deletions
|
@ -1002,18 +1002,18 @@ export class GBMinService {
|
||||||
|
|
||||||
// Removes <at>Bot Id</at> from MS Teams.
|
// Removes <at>Bot Id</at> from MS Teams.
|
||||||
|
|
||||||
context.activity.text = context.activity.text.trim();
|
|
||||||
context.activity.text = context.activity.text.replace(/\<at\>.*\<\/at\>\s/gi, '');
|
context.activity.text = context.activity.text.replace(/\<at\>.*\<\/at\>\s/gi, '');
|
||||||
|
|
||||||
// Syn. temporary replacement (to be migrated to Synonyms.xlsx)
|
let data = { query: context.activity.text };
|
||||||
|
await CollectionUtil.asyncForEach(min.appPackages, async (e: IGBPackage) => {
|
||||||
|
await e.onExchangeData(min, 'handleRawInput', data);
|
||||||
|
// TODO: Handle priority over .gbapp, today most common case is just one item per server.
|
||||||
|
});
|
||||||
|
context.activity.text = data.query;
|
||||||
|
|
||||||
context.activity.text = context.activity.text.replace(/\busuario\b/gi, 'usuário');
|
// Additional clean up.
|
||||||
context.activity.text = context.activity.text.replace(/\busuaria\b/gi, 'usuária');
|
|
||||||
context.activity.text = context.activity.text.replace(/\busuarios\b/gi, 'usuários');
|
|
||||||
context.activity.text = context.activity.text.replace(/\busuarias\b/gi, 'usuárias');
|
|
||||||
context.activity.text = context.activity.text.replace(/\bfuncionario\b/gi, 'funcionário');
|
|
||||||
context.activity.text = context.activity.text.replace(/\bfuncionarios\b/gi, 'funcionários');
|
|
||||||
|
|
||||||
|
context.activity.text = context.activity.text.trim();
|
||||||
|
|
||||||
const user = await min.userProfile.get(context, {});
|
const user = await min.userProfile.get(context, {});
|
||||||
let message: GuaribasConversationMessage;
|
let message: GuaribasConversationMessage;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
export const Messages = {
|
export const Messages = {
|
||||||
global_quit: /^(sair|sai|chega|exit|quit|finish|end|ausfahrt|verlassen)/i,
|
global_quit: /^(\bsair\b|\bsai\b|\bchega\b|\bexit\b|\bquit\b|\bfinish\b|\bend\b|\bausfahrt\b|\bverlassen\b)/i,
|
||||||
'en-US': {
|
'en-US': {
|
||||||
show_video: 'I will show you a video, please wait...',
|
show_video: 'I will show you a video, please wait...',
|
||||||
good_morning: 'good morning',
|
good_morning: 'good morning',
|
||||||
|
@ -13,7 +13,7 @@ export const Messages = {
|
||||||
which_language: 'Please, type the language name you would like to talk through.',
|
which_language: 'Please, type the language name you would like to talk through.',
|
||||||
validation_enter_valid_email: 'Please enter a valid e-mail.',
|
validation_enter_valid_email: 'Please enter a valid e-mail.',
|
||||||
language_chosen: 'Very good, so let\'s go...',
|
language_chosen: 'Very good, so let\'s go...',
|
||||||
affirmative_sentences: /^(sim|s|positivo|afirmativo|claro|evidente|sem dúvida|confirmo|confirmar|confirmado|uhum|si|y|yes|sure)/i
|
affirmative_sentences: /^(\bsim\b|\bs\b|\bpositivo\b|\bafirmativo\b|\bclaro\b|\bevidente\b|\bsem dúvida\b|\bconfirmo\b|\bconfirmar\b|\bconfirmado\b|\buhum\b|\bsi\b|\by\b|\byes\b|\bsure\b)/i
|
||||||
|
|
||||||
},
|
},
|
||||||
'pt-BR': {
|
'pt-BR': {
|
||||||
|
@ -28,7 +28,7 @@ export const Messages = {
|
||||||
which_language: 'Por favor, digite o idioma que você gostaria de usar para conversarmos.',
|
which_language: 'Por favor, digite o idioma que você gostaria de usar para conversarmos.',
|
||||||
validation_enter_valid_email: 'Por favor digite um email válido.',
|
validation_enter_valid_email: 'Por favor digite um email válido.',
|
||||||
language_chosen: 'Muito bem, então vamos lá...',
|
language_chosen: 'Muito bem, então vamos lá...',
|
||||||
affirmative_sentences: /^(sim|s|positivo|afirmativo|claro|evidente|sem dúvida|confirmo|confirmar|confirmado|uhum|si|y|yes|sure)/i
|
affirmative_sentences: /^(\bsim\b|\bs\b|\bpositivo\b|\bafirmativo\b|\bclaro\b|\bevidente\b|\bsem dúvida\b|\bconfirmo\b|\bconfirmar\b|\bconfirmado\b|\buhum\b|\bsi\b|\by\b|\byes\b|\bsure\b)/i
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -612,7 +612,10 @@ export class KBService implements IGBKBService {
|
||||||
*/
|
*/
|
||||||
public async importDocs(min: GBMinInstance, localPath: string, instance: IGBInstance, packageId: number): Promise<any> {
|
public async importDocs(min: GBMinInstance, localPath: string, instance: IGBInstance, packageId: number): Promise<any> {
|
||||||
const files = await walkPromise(urlJoin(localPath, 'docs'));
|
const files = await walkPromise(urlJoin(localPath, 'docs'));
|
||||||
|
if (!files[0]) {
|
||||||
|
GBLog.info(`[GBDeployer] docs folder not created yet in .gbkb. To use Reading Comprehension, create this folder at root and put a document to get read by the.`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
await CollectionUtil.asyncForEach(files, async file => {
|
await CollectionUtil.asyncForEach(files, async file => {
|
||||||
let content = null;
|
let content = null;
|
||||||
let filePath = Path.join(file.root, file.name);
|
let filePath = Path.join(file.root, file.name);
|
||||||
|
@ -638,6 +641,7 @@ export class KBService implements IGBKBService {
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async importKbTabularDirectory(localPath: string, instance: IGBInstance, packageId: number): Promise<any> {
|
public async importKbTabularDirectory(localPath: string, instance: IGBInstance, packageId: number): Promise<any> {
|
||||||
const files = await walkPromise(localPath);
|
const files = await walkPromise(localPath);
|
||||||
|
|
Loading…
Add table
Reference in a new issue