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

Comments

fix lu parser error when invalid square brackets occur in utterances#825

Merged
feich-ms merged 4 commits intomasterfrom
feich/luParserError
Jun 5, 2020
Merged

fix lu parser error when invalid square brackets occur in utterances#825
feich-ms merged 4 commits intomasterfrom
feich/luParserError

Conversation

@feich-ms
Copy link
Contributor

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

fix #795. Before the fix, the square brackets occur after an intent will be treated as import section which caused the intent body missed the error intent line. After the fix, the invalid square brackets will be treated as error intent line instead of import section so that it can be included in the body of the intent.

@feich-ms feich-ms requested a review from munozemilio as a code owner May 27, 2020 11:26
@feich-ms feich-ms requested a review from boydc2014 May 27, 2020 13:57
@feich-ms feich-ms changed the title fix lu parser error when invalid import section occurs in utterances fix lu parser error when invalid square brackets occur in utterances May 27, 2020
@feich-ms
Copy link
Contributor Author

feich-ms commented Jun 3, 2020

@vishwacsena @munozemilio could you please help to take a look at this PR?

@vishwacsena
Copy link
Contributor

Not sure I follow why this is not an error .. can you clarify?

[]
[
]

@feich-ms
Copy link
Contributor Author

feich-ms commented Jun 4, 2020

@vishwacsena. It is 100% error and it will throw out. The changes here is to make sure the next valid intent section is not impacted by this error when parsing. Composer is using the lu parser in their lu editor. They want lu parser to have the capability of parsing with errors which means error text in current section can be pased into Body (even though the errors are caught)and errors in current section doesn't impact next valid section parsing. For example,

Considering below lu content

`# Greeting
- hi
[]
# Cancel
- cancel that`;

The parsed lu resource will have error of Invalid intent body line, did you miss \'-\' at line begin but the Body of Greeting intent will be - hi$\r\n[] and Cancel intent can be parsed correctly.

@feich-ms feich-ms merged commit 7ded18e into master Jun 5, 2020
@feich-ms feich-ms deleted the feich/luParserError branch June 5, 2020 03:08
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.

lu parser issue editing Luis intent mess up the file

3 participants