From 2a64114b9327c3cab6996477b4e9ebb8f731741f Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 2 Aug 2016 15:13:10 -0400 Subject: [PATCH] update readme --- README.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4045f1d3bb91..fde1bfff2713 100644 --- a/README.md +++ b/README.md @@ -776,21 +776,42 @@ 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'] @@ -798,7 +819,7 @@ language.detectEntities('Stephen is in Michigan!', function(err, entities) { }); // 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) {