-
Notifications
You must be signed in to change notification settings - Fork 129
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
Cross-Train generates a file with wrong culture #1295
Comments
One possible solution I found is to check here for culture information in file name and possibly update const fileHelpers = require('./../../utils/filehelper');
// ...
class Lu {
constructor(content, options = new luOptions){
// ...
if (this.language !== '') {
this.name = this.id + '.' + this.language + '.lu'
} else {
this.name = this.id + '.lu'
// Check if culture is specified in name
const fileCulture = fileHelpers.getLuisCultureFromPath(this.name);
if (fileCulture) {
// If so, update language property
this.language = fileCulture;
}
}
}
}
// ... This permits to have const parseAndHandleModelInfoSection = function (parsedContent, luResource, log, config, locale = '') {
// ...
let cultureSet = false;
if (modelInfos && modelInfos.length > 0) {
// ...
for (const modelInfo of modelInfos) {
//...
if (kvPair.length === 4) {
// ...
if (kvPair[1].toLowerCase() === 'app') {
if (kvPair[2].toLowerCase().startsWith('settings')) {
// ...
} else {
cultureSet = kvPair[2].toLowerCase() === 'culture';
parsedContent.LUISJsonStructure[kvPair[2]] = kvPair[3];
}
}
// ...
}
// ...
}
// ...
}
if (!cultureSet && locale) {
parsedContent.LUISJsonStructure.culture = locale;
}
} Eventually, call of this method here needs to be updated to: let enableMergeIntents = parseAndHandleModelInfoSection(parsedContent, luResource, log, config, locale); |
@boydc2014 Could you have a look at this ticket when you get a moment. |
Sure looking at it. |
@cosmicshuai have a PR to fix this linked above |
Versions
What CLI version are you using: 4.14.1
What Nodejs version are you using: 14.17.1
What command-line interpreters are you using: CMD (Windows' command prompt)
What OS are you using: Win10 x64
Describe the bug
If a file is created without app information in the header part (i.e.:
@app.version
etc.), culture specified via filename, e.g.:MyBot.it-it.lu
is not taken into account. This causes a wrong check for prebuilt entities availability.This closely relates to #1292. In fact, that issue must be addressed before this one to allow the culture information to pass along methods' calls.
Possible solution in first comment.
To Reproduce
BF Composer Way
en-us
.lu
files generated inpath/to/your/bot/generated/interruption
. In header section you will find for every.lu
fileBF CLI way
MyBot.it-it.lu
bf luis:cross-train
passing arguments as per docs.lu
fileExpected behavior
It should generate a
.lu
file with correct culture information, provided it's not specified in file header but it is in filename.Screenshots
Not applicable
Additional context
This issue affects also BotFramework Composer which makes use of cross train to generate intermediate
.lu
files[bug]
The text was updated successfully, but these errors were encountered: