Comparing version 0.2.1 to 0.3.0
{ | ||
"name": "wink-ner", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Language agnostic named entity recognizer", | ||
@@ -33,17 +33,17 @@ "keywords": [ | ||
"chai": "^4.1.2", | ||
"coveralls": "^3.0.0", | ||
"coveralls": "^3.0.1", | ||
"docker": "^1.0.0", | ||
"documentation": "^5.3.5", | ||
"eslint": "^4.16.0", | ||
"istanbul": "^0.4.5", | ||
"documentation": "^8.0.0", | ||
"eslint": "^4.19.1", | ||
"istanbul": "^1.1.0-alpha.1", | ||
"jshint": "^2.9.5", | ||
"mocha": "^5.0.0", | ||
"mocha": "^5.2.0", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"wink-tokenizer": "^2.1.0" | ||
"wink-tokenizer": "^4.0.0" | ||
}, | ||
"runkitExampleFilename": "./runkit/example.js", | ||
"dependencies": { | ||
"wink-helpers": "^1.3.0", | ||
"wink-lemmatizer": "^1.0.0" | ||
"wink-helpers": "^1.4.0", | ||
"wink-lemmatizer": "^2.0.0" | ||
} | ||
} |
@@ -117,3 +117,3 @@ // wink-ner | ||
if ( config.tagsToIgnore && !helpers.validate.isArray( config.tagsToIgnore ) ) { | ||
throw Error( 'wink-ner/defineConfig: valuesToIgnore must be an array, instead found: ' + JSON.stringify( config.tagsToIgnore ) ); | ||
throw Error( 'wink-ner/defineConfig: tagsToIgnore must be an array, instead found: ' + JSON.stringify( config.tagsToIgnore ) ); | ||
} | ||
@@ -149,3 +149,3 @@ | ||
const key = ignore[ i ]; | ||
if ( !key && ( typeof key !== 'string' ) ) { | ||
if ( key && ( typeof key !== 'string' ) ) { | ||
throw Error( 'wink-ner/defineConfig: tagsToIgnore must contain strings, instead found: ' + JSON.stringify( ignore ) ); | ||
@@ -162,3 +162,3 @@ } | ||
const key = ignore[ i ]; | ||
if ( !key && ( typeof key !== 'string' ) ) { | ||
if ( key && ( typeof key !== 'string' ) ) { | ||
throw Error( 'wink-ner/defineConfig: valuesToIgnore must contain strings, instead found: ' + JSON.stringify( ignore ) ); | ||
@@ -494,3 +494,3 @@ } | ||
// Look up for the word; if not found try its base form. | ||
let value = t.value || ''; | ||
let value = t.value; | ||
value = normalize( value ); | ||
@@ -514,3 +514,3 @@ candidate = uniWordEntities[ value ]; | ||
switch ( action ) { | ||
switch ( action ) { // eslint-disable-line default-case | ||
case 1: | ||
@@ -543,4 +543,2 @@ // Non-entity, just push the token to `nerdts`. | ||
break; | ||
default: | ||
throw Error( 'Unknown exception!' ); | ||
} | ||
@@ -562,14 +560,33 @@ } else { | ||
var initialize = function ( ) { | ||
// Define default configuration. | ||
// Ignore `punctuation`; | ||
cfg.tagsToIgnore = Object.create( null ); | ||
cfg.tagsToIgnore.punctuation = true; | ||
// Leave values to ignore `undefined`; | ||
cfg.valuesToIgnore = Object.create( null ); | ||
// And ignore diacritics by default. | ||
cfg.ignoreDiacritics = true; | ||
// Initialize learnings | ||
uniWordEntities = Object.create( null ); | ||
multiWordEntities = Object.create( null ); | ||
}; // initialize() | ||
// ### reset | ||
/** | ||
* | ||
* Resets the named entity recognizer by re-initializing all the learnings and | ||
* by setting the configuration to default. | ||
* | ||
* @return {boolean} always true. | ||
* @example | ||
* myNER.reset( ); | ||
* // -> true | ||
*/ | ||
var reset = function ( ) { | ||
initialize(); | ||
return true; | ||
}; // reset() | ||
// Define default configuration. | ||
// Ignore `punctuation`; | ||
cfg.tagsToIgnore = Object.create( null ); | ||
cfg.tagsToIgnore.punctuation = true; | ||
// Leave values to ignore `undefined`; | ||
cfg.valuesToIgnore = Object.create( null ); | ||
// And ignore diacritics by default. | ||
cfg.ignoreDiacritics = true; | ||
initialize(); | ||
@@ -576,0 +593,0 @@ methods.defineConfig = defineConfig; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69852
8
563
+ Addedwink-lemmatizer@2.0.0(transitive)
- Removedwink-lemmatizer@1.0.0(transitive)
Updatedwink-helpers@^1.4.0
Updatedwink-lemmatizer@^2.0.0