watson-developer-cloud
Advanced tools
Comparing version 0.9.20 to 0.9.21
{ | ||
"name": "watson-developer-cloud", | ||
"version": "0.9.20", | ||
"version": "0.9.21", | ||
"description": "Nodejs Client Wrapper to use the IBM Watson Services", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
@@ -32,3 +32,15 @@ /** | ||
/** | ||
* Main API call. Returns the different tone dimensions of a text. | ||
* | ||
* @param params: An object with a string 'text' element. This is the | ||
* only field used. By this API call | ||
* | ||
* @return upon success, the callback function is called with an object | ||
* containing the different tones (emotion, writing and social), traits | ||
* and the evidence words found in the text. | ||
* | ||
* @see the API docs for a the full documentation. | ||
* | ||
*/ | ||
ToneAnalyzer.prototype.tone = function(params, callback) { | ||
@@ -49,3 +61,3 @@ if (!params || !params.text){ | ||
'accept':'application/json', | ||
'content-type': 'plain/text' | ||
'content-type': 'text/plain' | ||
} | ||
@@ -58,2 +70,22 @@ }) | ||
/** | ||
* Returns related words for a given word (or set of words). | ||
* | ||
* @param params: An object with an array of strings 'words'. These are | ||
* the terms to look for and suggest synonyms. A 'limit' parameter is | ||
* also accepted to limit the number of related words suggested. | ||
* | ||
* @return upon success, the callback function is called with an object | ||
* containing related words to the ones given. Each word comes with | ||
* the semantic type and the meaning and sense of the root word, and | ||
* a weight associated to a trait. Positive weights would 'level up' | ||
* that particular tone, while negative weights would level it down. | ||
* | ||
* For example, if one wants to sound less "angry" on a message, the | ||
* suggestions with negative correlation with "Anger" (Emotion Tone) | ||
* could be replaced in the txt. | ||
* | ||
* @see the API docs for a the full documentation. | ||
* | ||
*/ | ||
ToneAnalyzer.prototype.synonym = function(params, callback) { | ||
@@ -68,3 +100,8 @@ var parameters = { | ||
requiredParams: ['words', 'limit'], | ||
defaultOptions: this._options | ||
defaultOptions: extend(this._options, { | ||
headers: { | ||
'accept':'application/json', | ||
'content-type': 'application/json' | ||
} | ||
}) | ||
}; | ||
@@ -75,2 +112,2 @@ | ||
module.exports = ToneAnalyzer; | ||
module.exports = ToneAnalyzer; |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
152542
28
2271
3