-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * Fixes #15. Added new file sentiment-analysis.js. Added dependencies * Fixed Typo in comments * Update src/sentiment-analysis.js Adds async function. Co-Authored-By: David Humphrey <david.humphrey@senecacollege.ca> * Replaced var with const, updated function. * Updated sentiment-analysis.js
- Loading branch information
1 parent
8e16281
commit a9a2ce8
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* This file contains the code for analyzing blog posts text to identify the | ||
* negative or positve words being used in a post and return a summary of it | ||
* along with a score. The file uses a node module called sentiment to implement | ||
* the functionality of analyzing text of blogs. The function accepts plain | ||
* text as a parameter i.e text containg no HTML tags, and returns a promise | ||
* object whcih contains the result. | ||
*/ | ||
const Sentiment = require('sentiment'); | ||
|
||
module.exports.run = async function (text) { | ||
const sentiment = new Sentiment(); | ||
return Promise.resolve(sentiment.analyze(text)); | ||
}; |