-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: multiple lg #1861
feat: multiple lg #1861
Conversation
One last thing, after some digging into, i finally can repro the warning message in console. Create a bot with the master branch, and use this branch to open it. You will see some errors in console complaining about '\r'. I believe there is some thing happening in your conversion phrase (by the way, this conversion logic is great), i think perhaps there are some issue in this version of lg parser when doing CRUD, not sure. Please take a look. |
Hi @boydc2014 @cwhitten After some investments, I found two reason cause this error lg.
To fix 2, I convert all '\r' to '\r\n' ( like lg parser doing ). By doing this, we can ensure Composer would not produce lg file end with |
fa285a8
to
6fdba8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing, after some digging into, i finally can repro the warning message in console. Create a bot with the master branch, and use this branch to open it. You will see some errors in console complaining about '\r'.
I believe there is some thing happening in your conversion phrase (by the way, this conversion logic is great), i think perhaps there are some issue in this version of lg parser when doing CRUD, not sure. Please take a look.Hi @boydc2014 @cwhitten After some investments, I found two reason cause this error lg.
- lg Parser do not support file end with '\r', that's why we could only re-pro it in windows, not *nix.
- When splitting common.lg, by mistake I use '\n' as NEWLINE splitter, but windows NEWLINE is '\r\n'.
To fix 2, I convert all '\r' to '\r\n' ( like lg parser doing ).
By doing this, we can ensure Composer would not produce lg file end with
\r
. But for other text editor, it may still be an issue for lg parser.
LG parser support both \n or \r\n as line break, just not '\r', because it's not a line break.
It's OK in composer to choose one flavor, like you said "\r\n", when saving files, just make sure not '\r' arrears alone somewhere at the end. Maybe choosing line break based on platform is better, but since all our sample bots is also kind of have some flavor, so it's OK for now.
@cwhitten if you are seeing warning messages in console, you should remove the last line-break(\r) in your LG file, because you've checked out this branch, so your opening bot has been converted once which introduce this '\r' at end. Since it's fixed, it won't affect existing user.
Description
Add support for multiple lg file.
changes:
1. Bot file structure:
Each when create a dialog, lg/lu will also be created. same as deleting.
2. support lg import
lgIndexer/parse,check
now support call with animportResolverDelegate
.and default importResolverDelegate implemented in server and client/store
3. visual editor
new created lg, will save to dialog's lg file, not common.lg anymore.
4. auto migration from single-lg bot
auto move generated lg template (like bfdactivity-123456) from common.lg into dialog.lg
Task Item
close #796
close #1871
Type of change
Please delete options that are not relevant.
Checklist
Screenshots