Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Comments

fix pattern issue in cross train core lib#759

Merged
munozemilio merged 1 commit into4.9from
feich/fixPatternIssueInCrossTrainLib
May 6, 2020
Merged

fix pattern issue in cross train core lib#759
munozemilio merged 1 commit into4.9from
feich/fixPatternIssueInCrossTrainLib

Conversation

@feich-ms
Copy link
Contributor

@feich-ms feich-ms commented May 6, 2020

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.

@feich-ms
Copy link
Contributor Author

feich-ms commented May 6, 2020

Please help to take this PR to next RC as it is resolving an issue tagged as P0 by composer today @munozemilio @vishwacsena.

@feich-ms feich-ms changed the title fix pattern issue in cross train fix pattern issue in cross train core lib May 6, 2020
Copy link

@beyackle beyackle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter could be written as i => ! ( /{([^}]+)}/g.test(i) ).

Copy link

@beyackle beyackle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes I requested are just minor ones and we need to move quickly on this, so I'll approve it.

@munozemilio munozemilio merged commit 67ed91d into 4.9 May 6, 2020
munozemilio pushed a commit that referenced this pull request May 6, 2020
munozemilio added a commit that referenced this pull request May 6, 2020
Co-authored-by: Fei Chen <43032123+feich-ms@users.noreply.github.com>
@feich-ms feich-ms deleted the feich/fixPatternIssueInCrossTrainLib branch May 12, 2020 07:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants