fix pattern issue in cross train core lib#759
Conversation
|
Please help to take this PR to next RC as it is resolving an issue tagged as P0 by composer today @munozemilio @vishwacsena. |
beyackle
left a comment
There was a problem hiding this comment.
The code here looks good apart from some minor stylistic things; the question I can't answer myself (and would like someone else to look at) is if this is semantically the correct thing to do.
| const specificSections = intentSections.filter(s => s.Name === intentName) | ||
| if (specificSections.length > 0) { | ||
| intentUtterances = intentUtterances.concat(specificSections[0].UtteranceAndEntitiesMap.map(u => u.utterance).filter(i => curlyRe.exec(i) === null)) | ||
| intentUtterances = intentUtterances.concat(specificSections[0].UtteranceAndEntitiesMap.map(u => u.utterance)) |
There was a problem hiding this comment.
Is there a reason we can't just change these (here and on lines 314 and 317) to intentUtterances.push() instead of making a whole new array and reassigning the variable to it?
| } | ||
|
|
||
| // remove utterances with curly brackets | ||
| const utterancesWithoutPatterns = utterances.filter(i => /{([^}]+)}/g.exec(i) === null) |
There was a problem hiding this comment.
This filter could be written as i => ! ( /{([^}]+)}/g.test(i) ).
beyackle
left a comment
There was a problem hiding this comment.
The changes I requested are just minor ones and we need to move quickly on this, so I'll approve it.
Fix issue reported in composer here microsoft/BotFramework-Composer#2749. It was marked as P0 of R9 RC just recently(5.5). If we think this is release blocker for composer, we should make it in.
The main changes are removing all patterns with prebuilt entity as patternany entity in Interruption intent. For other patterns, we still keep them in Interruption intent.