-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f4b44f
commit 7d0abf0
Showing
14 changed files
with
194 additions
and
281 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
build: | ||
node ./build/index.js | ||
|
||
generator: | ||
npm install | ||
git init | ||
git add -A | ||
git remote add origin https://thisandagain@github.com/thisandagain/sentiment | ||
test: | ||
./node_modules/.bin/tap test/governance/*.js | ||
./node_modules/.bin/tap test/unit/*.js | ||
|
||
.PHONY: build generator | ||
benchmark: | ||
node test/benchmark/index.js | ||
|
||
.PHONY: build test benchmark |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var fs = require('fs'), | ||
hint = require('hint-hint'); | ||
|
||
var config = fs.readFileSync(__dirname + '/../../.jshintrc'); | ||
hint(__dirname + '/../../lib/*.js', JSON.parse(config)); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var async = require('async'), | ||
test = require('tap').test, | ||
sentiment = require(__dirname + '/../../lib/index'); | ||
|
||
var load = [ | ||
'In America I doubt it could sustain itself without descending into identity politics and ego.', | ||
'You are deluding yourself if you think that identity politics and ego are purely American.', | ||
'Posting a show that cost $5 and was for charity is pretty low and I thought better of BoingBoing. A clip or two would be great, but just pirating something like this is lame.', | ||
'I paid the $5, only got to see the last 30 minutes of the event, and cant download it today, because when I log in, it asks for my credit card information. So the only way it looks like Ill get to watch it is through a pirated copy.', | ||
'Thanks for posting it, Cory! What Ive seen of the debate was awesome, but from a technical and customer service standpoint, it was a catastrophe.', | ||
'Bill OReillys total inability to shut up while anyone else is speaking makes me either wonder how he ever got his job, or think that you can be inordinately successful just by bullying.' | ||
]; | ||
|
||
async.map(load, function (obj, callback) { | ||
sentiment(obj, callback); | ||
}, function (err, obj) { | ||
console.dir(err); | ||
console.dir(obj); | ||
|
||
test('unit', function (t) { | ||
t.equal(err, null, 'error object should be null'); | ||
t.type(obj, 'object', 'results should be an object'); | ||
t.equal(obj.length, 6, 'results should be of expected length'); | ||
|
||
t.equal(obj[0].score, -1, 'Expected score'); | ||
t.equal(obj[0].comparative, -0.06666666666666667, 'Expected comparative score'); | ||
t.equal(obj[0].tokens.length, 15, 'Expected tokens length'); | ||
t.equal(obj[0].words.length, 1, 'Expected match length'); | ||
|
||
t.end(); | ||
}); | ||
}); |
Oops, something went wrong.