Skip to content

Commit

Permalink
Merge pull request #66 from ThomasLuu00/issue-20
Browse files Browse the repository at this point in the history
Fixes #20: Added basic summarize functionality
  • Loading branch information
ThomasLuu00 committed Nov 14, 2019
2 parents 5857761 + a45dc1d commit fdda764
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 3 deletions.
76 changes: 73 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"express": "^4.17.1",
"express-healthcheck": "^0.1.0",
"feedparser-promised": "^2.0.1",
"node-summarizer": "^1.0.7",
"sentiment": "^5.0.2"
},
"devDependencies": {
Expand Down
6 changes: 6 additions & 0 deletions src/summarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { SummarizerManager } = require('node-summarizer');

module.exports = async function (text, numSentences = 3) {
const summarizer = new SummarizerManager(text, numSentences);
return summarizer.getSummaryByRank().then((summaryObject) => summaryObject.summary);
};
22 changes: 22 additions & 0 deletions test/summarize.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fdda764

Please sign in to comment.