@microsoft/bf-lu
Advanced tools
Comparing version 4.11.0-dev.20200916.4f7c793 to 4.11.0-dev.20200917.ec30167
@@ -77,2 +77,3 @@ "use strict"; | ||
idxToRemove.sort((a, b) => a - b).forEach(idx => luisObject.entities.splice(idx, 1)); | ||
delete luisObject.onAmbiguousLabels; | ||
}; | ||
@@ -79,0 +80,0 @@ const mergeResultsWithHash = function (blob, finalCollection, type, hashTable) { |
@@ -253,3 +253,8 @@ "use strict"; | ||
}); | ||
(finalLUISJSON.entities || []).forEach(entity => transformAllEntityConstraintsToFeatures(entity)); | ||
let phraseListsNamesInFinal = []; | ||
(finalLUISJSON.phraselists || []).forEach((item) => { | ||
if (!phraseListsNamesInFinal.includes(item.name)) | ||
phraseListsNamesInFinal.push(item.name); | ||
}); | ||
(finalLUISJSON.entities || []).forEach(entity => transformAllEntityConstraintsToFeatures(entity, phraseListsNamesInFinal)); | ||
(finalLUISJSON.intents || []).forEach(intent => addIsRequiredProperty(intent)); | ||
@@ -495,4 +500,4 @@ // do we have nDepthEntities? | ||
}; | ||
const transformAllEntityConstraintsToFeatures = function (entity) { | ||
addIsRequiredProperty(entity); | ||
const transformAllEntityConstraintsToFeatures = function (entity, phraseListsInFinal) { | ||
addIsRequiredProperty(entity, phraseListsInFinal); | ||
if (entity.hasOwnProperty("instanceOf") && entity.instanceOf !== null) { | ||
@@ -519,6 +524,10 @@ if (entity.hasOwnProperty("features") && Array.isArray(entity.features)) { | ||
}; | ||
const addIsRequiredProperty = function (item) { | ||
const addIsRequiredProperty = function (item, phraseListInFinal = []) { | ||
(item.features || []).forEach(feature => { | ||
if (feature.isRequired === undefined) | ||
feature.isRequired = false; | ||
if (feature.modelName !== undefined && phraseListInFinal.includes(feature.modelName)) { | ||
feature.featureName = feature.modelName; | ||
delete feature.modelName; | ||
} | ||
delete feature.featureType; | ||
@@ -525,0 +534,0 @@ delete feature.modelType; |
{ | ||
"name": "@microsoft/bf-lu", | ||
"version": "4.11.0-dev.20200916.4f7c793", | ||
"version": "4.11.0-dev.20200917.ec30167", | ||
"author": "Microsoft", | ||
@@ -5,0 +5,0 @@ "bugs": "https://github.com/microsoft/botframework-cli/issues", |
Sorry, the diff of this file is too big to display
856723
19103