-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor tests. * Tweak build. * Tweak build. * More tests. * Tweak build. * Tweak build. * Fix build. * Fix build. * Speed up build. * Fix build. * Remove extra dep. * Investigate why 0.12 fails. * Scripts. * More tests. * Upgrades * Upgrades * Update readme
- Loading branch information
Showing
3 changed files
with
91 additions
and
12 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,18 +1,17 @@ | ||
{ | ||
"name": "cloud-natural-language-api-samples", | ||
"version": "1.0.0", | ||
"description": "Samples for using the Google Cloud Natural Language API.", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/GoogleCloudPlatform/nodejs-docs-samples.git" | ||
}, | ||
"main": "analyze.js", | ||
"name": "nodejs-docs-samples-language", | ||
"version": "0.0.1", | ||
"private": true, | ||
"license": "Apache Version 2.0", | ||
"author": "Google Inc.", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../test/_setup.js test/*.test.js", | ||
"system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js" | ||
}, | ||
"dependencies": { | ||
"googleapis": "^11.0.0" | ||
"googleapis": "^12.0.0" | ||
}, | ||
"author": "Google, Inc.", | ||
"license": "Apache-2.0" | ||
"devDependencies": { | ||
"mocha": "^2.5.3" | ||
} | ||
} |
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,62 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
var analyzeExample = require('../../language/analyze'); | ||
|
||
describe('language:analyze', function () { | ||
it('should analyze sentiment in text', function (done) { | ||
analyzeExample.main( | ||
'sentiment', | ||
'This gazinga pin is bad and it should feel bad', | ||
function (err, result) { | ||
assert(!err); | ||
assert(result); | ||
assert(result.documentSentiment); | ||
assert(result.documentSentiment.polarity < 0); | ||
done(); | ||
} | ||
); | ||
}); | ||
it('should analyze entities in text', function (done) { | ||
analyzeExample.main( | ||
'entities', | ||
'Mark Twain is the author of a book called Tom Sawyer', | ||
function (err, result) { | ||
assert(!err); | ||
assert(result); | ||
assert(result.entities && result.entities.length); | ||
assert(result.entities[0].name === 'Mark Twain'); | ||
assert(result.entities[0].type === 'PERSON'); | ||
done(); | ||
} | ||
); | ||
}); | ||
it('should analyze syntax in text', function (done) { | ||
analyzeExample.main( | ||
'syntax', | ||
'Betty bought a bit of bitter butter. But she said, "This butter\'s ' + | ||
'bitter! If I put it in my batter, it will make my batter bitter. If I ' + | ||
'buy some better butter - better than this bitter butter - it will ' + | ||
'make my batter better."', | ||
function (err, result) { | ||
assert(!err); | ||
assert(result); | ||
assert(result.sentences && result.sentences.length); | ||
assert(result.tokens && result.tokens.length > 5); | ||
done(); | ||
} | ||
); | ||
}); | ||
}); |
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,18 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
describe('language:analyze', function () { | ||
it('should be tested'); | ||
}); |