Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Aug 2, 2016
1 parent 8cd0ac3 commit 2a64114
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -776,29 +776,50 @@ loggingClient.getEntries(function(err, entries) {
- [API Documentation][gcloud-language-docs]
- [Official Documentation][cloud-language-docs]

#### Using the all-in-one module

```
$ npm install --save google-cloud
```

```js
var gcloud = require('google-cloud');
var language = gcloud.language;
```

#### Using the Natural Language API module

```
$ npm install --save @google-cloud/language
```

```js
var language = require('@google-cloud/language');
```

#### Preview

```js
var gcloud = require('gcloud');
var gcloud = require('google-cloud');

// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).

var language = gcloud.language({
var languageClient = language({
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json'
});

// Get the entities from a sentence.
language.detectEntities('Stephen is in Michigan!', function(err, entities) {
languageClient.detectEntities('Stephen of Michigan!', function(err, entities) {
// entities = {
// people: ['Stephen'],
// places: ['Michigan']
// }
});

// Create a document if you plan to run multiple detections.
var document = language.document('Contributions welcome!');
var document = languageClient.document('Contributions welcome!');

// Analyze the sentiment of the document.
document.detectSentiment(function(err, positiveSentiment) {
Expand Down

0 comments on commit 2a64114

Please sign in to comment.