Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/bf-lu

Package Overview
Dependencies
Maintainers
6
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/bf-lu - npm Package Compare versions

Comparing version 4.14.0-dev.20210602.be805a8 to 4.14.0-dev.20210604.3f9ee15

33

lib/parser/cross-train/cross-train.js

@@ -11,2 +11,4 @@ "use strict";

const crossTrainer = require('./crossTrainer');
const LuisBuilder = require('./../luis/luisCollate');
const { parseUtterancesToLu } = require('./../luis/luConverter');
module.exports = {

@@ -37,7 +39,25 @@ /**

const locale = /\w\.\w/.test(idWithoutExt) ? idWithoutExt.split('.').pop() : defaultLocale;
for (let idx = 0; idx < idsToFind.length; idx++) {
let file = idsToFind[idx];
const intentFilteringHandler = async (filePathOrFound, intent, isAbsolutePath) => {
let content = filePathOrFound;
if (isAbsolutePath) {
importFile = (await filehelper.getFileContent(filePathOrFound, fileExtEnum.LUFile))[0];
content = importFile ? [importFile.content] : '';
}
const luObj = await LuisBuilder.build(content, false, undefined, importResolver);
const matchedUtterence = luObj.utterances.find(e => e.intent === intent);
const fileContent = `# ${intent}\r\n${parseUtterancesToLu([matchedUtterence], luObj)}`;
const foundItem = isAbsolutePath ? importFile : filePathOrFound[0];
const cloned = JSON.parse(JSON.stringify(foundItem));
cloned.content = fileContent;
importedContents.push(cloned);
};
for (const file of idsToFind) {
if (path.isAbsolute(file.filePath)) {
if (file.filePath.endsWith(fileExtEnum.LUFile)) {
importedContents.push(...await filehelper.getFilesContent(file.filePath, fileExtEnum.LUFile));
if (!file.intent) {
importedContents.push(...await filehelper.getFilesContent(file.filePath, fileExtEnum.LUFile));
}
else {
await intentFilteringHandler(file.filePath, file.intent, true);
}
}

@@ -62,3 +82,8 @@ else if (file.filePath.endsWith(fileExtEnum.QnAFile)) {

if (found.length > 0) {
importedContents.push(...found);
if (!file.intent) {
importedContents.push(...found);
}
else {
await intentFilteringHandler(found, file.intent, false);
}
}

@@ -65,0 +90,0 @@ else {

@@ -13,3 +13,6 @@ "use strict";

*/
constructor(filePath, includeInCollate) {
/**
* @property {string} intent
*/
constructor(filePath, includeInCollate, intent = '') {
this.filePath = filePath ? filePath : '';

@@ -20,2 +23,3 @@ if (includeInCollate === undefined)

this.includeInCollate = includeInCollate;
this.intent = intent;
}

@@ -22,0 +26,0 @@ }

@@ -547,2 +547,3 @@ "use strict";

module.exports = luisToLuContent;
module.exports.parseUtterancesToLu = parseUtterancesToLu;
//# sourceMappingURL=luConverter.js.map

2

package.json
{
"name": "@microsoft/bf-lu",
"version": "4.14.0-dev.20210602.be805a8",
"version": "4.14.0-dev.20210604.3f9ee15",
"author": "Microsoft",

@@ -5,0 +5,0 @@ "bugs": "https://github.com/microsoft/botframework-cli/issues",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc