wingbot 3.26.0 → 3.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.26.0",
3
+ "version": "3.26.1",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -194,8 +194,14 @@ class CustomEntityDetectionModel {
194
194
  }
195
195
  }
196
196
 
197
- _escapeRegex (string) {
198
- return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
197
+ _escapeRegex (string, shouldReplaceDiacritics) {
198
+ const ret = string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
199
+
200
+ if (!shouldReplaceDiacritics) {
201
+ return ret;
202
+ }
203
+
204
+ return replaceDiacritics(ret);
199
205
  }
200
206
 
201
207
  /**
@@ -426,7 +432,7 @@ class CustomEntityDetectionModel {
426
432
  let replaced = source.replace(/@[A-Z0-9-]+/g, (value) => {
427
433
  const matchingEntities = entities
428
434
  .filter((e) => `@${e.entity.toUpperCase()}` === value)
429
- .map((e) => this._escapeRegex(e.text));
435
+ .map((e) => this._escapeRegex(e.text, options.replaceDiacritics));
430
436
 
431
437
  if (matchingEntities.length === 0) {
432
438
  return value;