calais-entity-extractor
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -365,9 +365,14 @@ var request = require('request'); | ||
// parse to a Javascript object if requested | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
try { | ||
// parse to a Javascript object if requested | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
var parsedResult = calais._parseCalaisData(result, calais.options.minConfidence); | ||
var parsedResult = calais._parseCalaisData(result, calais.options.minConfidence); | ||
return cb(parsedResult, calais.errors); | ||
return cb(parsedResult, calais.errors); | ||
} catch { | ||
return cb({}, e); | ||
} | ||
} else | ||
@@ -438,9 +443,14 @@ return cb({}, 'Request error: ' + (typeof response === 'string' ? response : JSON.stringify(response))); | ||
// parse to a Javascript object if requested | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
try { | ||
// parse to a Javascript object if requested | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
var parsedResult = calais._parseCalaisData(result, calais.options.minConfidence); | ||
var parsedResult = calais._parseCalaisData(result, calais.options.minConfidence); | ||
return cb(parsedResult, calais.errors); | ||
return cb(parsedResult, calais.errors); | ||
} catch(e) { | ||
return cb({}, e); | ||
} | ||
} else | ||
@@ -496,9 +506,13 @@ return cb({}, 'Request error: ' + (typeof response === 'string' ? response : JSON.stringify(response))); | ||
// parse to a Javascript object if requested | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
try { | ||
// parse to a Javascript object if requested | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
var parsedResult = calais._parseCalaisSearchResult(result); | ||
var parsedResult = calais._parseCalaisSearchResult(result); | ||
return cb(parsedResult, calais.errors); | ||
return cb(parsedResult, calais.errors); | ||
} catch(e) { | ||
return cb({}, e); | ||
} | ||
} else | ||
@@ -539,8 +553,14 @@ return cb({}, 'Request error: ' + (typeof response === 'string' ? response : JSON.stringify(response))); | ||
// parse to a Javascript object if requested | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
try { | ||
// parse to a Javascript object if requested | ||
var parsedResult = calais._parseCalaisLookupResult(result); | ||
return cb(parsedResult, calais.errors); | ||
var result = JSON.parse(calaisData); | ||
result = (typeof result === 'string') ? JSON.parse(result) : result; | ||
var parsedResult = calais._parseCalaisLookupResult(result); | ||
return cb(parsedResult, calais.errors); | ||
} catch (e) { | ||
return cb({}, e); | ||
} | ||
} else | ||
@@ -547,0 +567,0 @@ return cb({}, 'Request error: ' + (typeof response === 'string' ? response : JSON.stringify(response))); |
{ | ||
"name": "calais-entity-extractor", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Extract entities from text using Open Calais.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
35904
535