Socket
Socket
Sign inDemoInstall

@telefonica/language-model-converter

Package Overview
Dependencies
Maintainers
14
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@telefonica/language-model-converter - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

8

lib/parser.js

@@ -63,2 +63,10 @@ "use strict";

sentences
.map((sentence) => {
let match = sentence.match(/\w+\[.*\]/);
if (match) {
let err = `White space missing before entity declaration in entry "${sentence}" -> "${match[0]}"`;
this.emitError(err);
}
return sentence;
})
.map((sentence) => this.searchMissedVariables(sentence, replacements, missedReplacements))

@@ -65,0 +73,0 @@ .map((sentence) => this.expandVariables(sentence, replacements, usedReplacements))

32

package.json
{
"name": "@telefonica/language-model-converter",
"version": "3.0.0",
"version": "3.1.0",
"description": "Language model converter yaml <-> json for LUIS",

@@ -22,4 +22,27 @@ "license": "Apache-2.0",

"security": "nsp check",
"test": "npm run build && mocha -R spec lib/**/*.spec.js"
"test": "npm run build && cross-env LOGOPS_LEVEL=fatal nyc mocha src/**/*.spec.ts"
},
"nyc": {
"extension": [
".ts",
".tsx"
],
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"exclude": [
"**/*.d.ts",
"**/*.spec.ts",
"**/test/*"
],
"require": [
"ts-node/register"
],
"reporter": [
"lcov",
"text"
],
"all": true
},
"dependencies": {

@@ -34,2 +57,3 @@ "commander": "^2.11.0",

"@types/commander": "^2.11.0",
"@types/glob": "^5.0.33",
"@types/js-yaml": "^3.9.1",

@@ -40,5 +64,5 @@ "@types/lodash": "^4.14.78",

"@types/sinon": "^2.3.6",
"@types/glob": "^5.0.33",
"chai": "^4.1.2",
"chai-eventemitter": "^1.1.1",
"cross-env": "^5.1.1",
"mocha": "^4.0.1",

@@ -48,2 +72,3 @@ "nock": "^9.0.25",

"nsp": "^2.8.1",
"nyc": "^11.3.0",
"parse-glob": "^3.0.4",

@@ -53,2 +78,3 @@ "shx": "^0.2.2",

"sinon-chai": "^2.14.0",
"ts-node": "^3.3.0",
"tslint": "^5.8.0",

@@ -55,0 +81,0 @@ "typescript": "^2.5.3"

@@ -104,2 +104,10 @@ /**

sentences
.map((sentence: string) => {
let match = sentence.match(/\w+\[.*\]/);
if (match) {
let err = `White space missing before entity declaration in entry "${sentence}" -> "${match[0]}"`;
this.emitError(err);
}
return sentence;
})
.map((sentence: string) => this.searchMissedVariables(sentence, replacements, missedReplacements))

@@ -193,3 +201,3 @@ .map((sentence: string) => this.expandVariables(sentence, replacements, usedReplacements))

}
private expandVariables(sentence: string, variables: Map<string, string[]>, usedVariables: Set<string>): string[]  {
private expandVariables(sentence: string, variables: Map<string, string[]>, usedVariables: Set<string>): string[] {
let expandedSentences = new Set([sentence]);

@@ -217,3 +225,3 @@ expandedSentences.forEach(sentence => {

private extractEntities(sentence: string): any[]  {
private extractEntities(sentence: string): any[] {
let regexEntity = /\[(.+?):(.+?)\]/g; // entities are tagged as [entityValue:entityType], ex. [Burgos:city]

@@ -220,0 +228,0 @@

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