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

@nlpjs/ner

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlpjs/ner - npm Package Compare versions

Comparing version 4.14.3 to 4.17.0

10

package.json
{
"name": "@nlpjs/ner",
"version": "4.14.3",
"version": "4.17.0",
"description": "Named Entity Recognition",

@@ -28,7 +28,7 @@ "author": {

"dependencies": {
"@nlpjs/core": "^4.14.0",
"@nlpjs/language-min": "^4.6.0",
"@nlpjs/similarity": "^4.14.0"
"@nlpjs/core": "^4.17.0",
"@nlpjs/language-min": "^4.17.0",
"@nlpjs/similarity": "^4.17.0"
},
"gitHead": "1f8a3bcfe527f0dbb6c7effdfe092b9b9af0d02a"
"gitHead": "5a7730f9460a741b56386c8bd7d90ca25b53435f"
}

@@ -185,3 +185,3 @@ /*

}
return allRules.filter((x) => x.type === 'enum');
return allRules;
}

@@ -264,21 +264,23 @@

const current = rule.rules[i];
for (let j = 0; j < current.texts.length; j += 1) {
const newEdges = this.getBestSubstringList(
text,
current.texts[j],
words,
current.threshold || threshold
);
for (let k = 0; k < newEdges.length; k += 1) {
edges.push({
...newEdges[k],
entity: rule.name,
type: rule.type,
option: rule.rules[i].option,
sourceText: current.texts[j],
utteranceText: text.substring(
newEdges[k].start,
newEdges[k].end + 1
),
});
if (current && current.option && Array.isArray(current.texts)) {
for (let j = 0; j < current.texts.length; j += 1) {
const newEdges = this.getBestSubstringList(
text,
current.texts[j],
words,
current.threshold || threshold
);
for (let k = 0; k < newEdges.length; k += 1) {
edges.push({
...newEdges[k],
entity: rule.name,
type: rule.type,
option: rule.rules[i].option,
sourceText: current.texts[j],
utteranceText: text.substring(
newEdges[k].start,
newEdges[k].end + 1
),
});
}
}

@@ -285,0 +287,0 @@ }

@@ -38,3 +38,3 @@ /*

}
return allRules.filter((x) => x.type === 'regex');
return allRules;
}

@@ -46,3 +46,3 @@

do {
const match = regex.exec(utterance);
const match = regex instanceof RegExp ? regex.exec(utterance) : null;
if (match) {

@@ -49,0 +49,0 @@ result.push({

@@ -250,16 +250,18 @@ /*

const result = [];
for (let i = 0; i < condition.words.length; i += 1) {
const word = condition.options.noSpaces
? condition.words[i]
: ` ${condition.words[i]}`;
const wordPositions = this.findWord(utterance, word);
if (!condition.options.noSpaces) {
const wordPositions2 = this.findWord(utterance, condition.words[i]);
if (wordPositions2.length > 0 && wordPositions2[0].start === 0) {
wordPositions.unshift(wordPositions2[0]);
if (condition && Array.isArray(condition.words)) {
for (let i = 0; i < condition.words.length; i += 1) {
const word = condition.options.noSpaces
? condition.words[i]
: ` ${condition.words[i]}`;
const wordPositions = this.findWord(utterance, word);
if (!condition.options.noSpaces) {
const wordPositions2 = this.findWord(utterance, condition.words[i]);
if (wordPositions2.length > 0 && wordPositions2[0].start === 0) {
wordPositions.unshift(wordPositions2[0]);
}
}
if (wordPositions.length > 0) {
result.push(...this.getResults(utterance, wordPositions, type, name));
}
}
if (wordPositions.length > 0) {
result.push(...this.getResults(utterance, wordPositions, type, name));
}
}

@@ -280,3 +282,3 @@ const filteredResult = [];

}
return allRules.filter((x) => x.type === 'trim');
return allRules;
}

@@ -283,0 +285,0 @@

@@ -0,0 +0,0 @@ /*

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