fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
2 changed files with 19 additions and 1 deletions
Showing only changes of commit d48cb03c32 - Show all commits

View file

@ -241,6 +241,7 @@ export class GBVMService extends GBService {
let page = null;
let files = [];
let col = 1;
let index = 1
// Transfers NLP auto variables into global object.

View file

@ -901,7 +901,7 @@ export class SystemKeywords {
let getFilter = async text => {
let filter;
const operators = [/\<\=/, /\>\=/, /\</, /\>/, /\bnot in\b/, /\bin\b/, /\=/];
const operators = [/\<\=/, /\<\>/, /\>\=/, /\</, /\>/, /\bnot in\b/, /\bin\b/, /\=/];
let done = false;
await CollectionUtil.asyncForEach(operators, async op => {
var re = new RegExp(op, 'gi');
@ -993,9 +993,15 @@ export class SystemKeywords {
if (user && params && params.wholeWord) {
wholeWord = params.wholeWord;
}
if (!result)
{
return;
}
switch (filter.dataType) {
case 'string':
const v1 = GBConversationalService.removeDiacritics(result.toLowerCase().trim());
const v2 = GBConversationalService.removeDiacritics(filter.value.toLowerCase().trim());
@ -1011,6 +1017,17 @@ export class SystemKeywords {
}
}
break;
case '<>':
if (wholeWord) {
if (v1 !== v2) {
filterAcceptCount++;
}
} else {
if (v1.indexOf(v2) === -1) {
filterAcceptCount++;
}
}
break;
case 'not in':
if (wholeWord) {
if (v1 !== v2) {