Skip to content

Commit

Permalink
Docs fixes (#2170)
Browse files Browse the repository at this point in the history
datastore: fix broken links
logging: fix broken links
storage: fix broken links
language: fix docs
spanner: fix formatting in docs
  • Loading branch information
stephenplusplus authored Mar 31, 2017
1 parent 24e5426 commit 81b5bd1
Show file tree
Hide file tree
Showing 12 changed files with 238 additions and 346 deletions.
106 changes: 83 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,43 +305,103 @@ var languageClient = language({

// Get the entities from a sentence.
languageClient.detectEntities('Stephen of Michigan!', function(err, entities) {
// entities = {
// people: ['Stephen'],
// places: ['Michigan']
// }
// entities = [
// {
// name: 'Stephen',
// type: 'PERSON',
// metadata: {
// mid: '/m/05d8y4q'
// },
// salience: 0.7309288382530212,
// mentions: [
// {
// text: {
// content: 'Stephen',
// beginOffset: -1
// },
// type: 'PROPER'
// }
// ]
// },
// // ...
// ]
});

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

// Analyze the sentiment of the document.
document.detectSentiment(function(err, sentiment) {
// sentiment = 100 // Large numbers represent more positive sentiments.
// sentiment = {
// magnitude: 0.5,
// score: 0.5
// }
});

// Parse the syntax of the document.
document.annotate(function(err, annotations) {
// annotations = {
document.annotate(function(err, annotation) {
// annotation = {
// language: 'en',
// sentiment: 100,
// entities: {},
// sentences: ['Contributions welcome!'],
// tokens: [
// sentiment: {
// magnitude: 0.30000001192092896,
// score: 0.30000001192092896
// },
// entities: [
// {
// text: 'Contributions',
// partOfSpeech: 'Noun (common and proper)',
// partOfSpeechTag: 'NOUN'
// },
// {
// text: 'welcome',
// partOfSpeech: 'Verb (all tenses and modes)',
// partOfSpeechTag: 'VERB'
// },
// name: 'Contributions',
// type: 'OTHER',
// metadata: {},
// salience: 1,
// mentions: [
// {
// text: {
// content: 'Contributions',
// beginOffset: -1
// },
// type: 'COMMON'
// }
// ]
// }
// ],
// sentences: [
// {
// text: '!',
// partOfSpeech: 'Punctuation',
// partOfSpeechTag: 'PUNCT'
// text: {
// content: 'Contributions welcome!',
// beginOffset: -1
// },
// sentiment: {
// magnitude: 0.30000001192092896,
// score: 0.30000001192092896
// }
// }
// ],
// tokens: [
// {
// text: {
// content: 'Contributions',
// beginOffset: -1
// },
// partOfSpeech: {
// tag: 'NOUN',
// aspect: 'ASPECT_UNKNOWN',
// case: 'CASE_UNKNOWN',
// form: 'FORM_UNKNOWN',
// gender: 'GENDER_UNKNOWN',
// mood: 'MOOD_UNKNOWN',
// number: 'PLURAL',
// person: 'PERSON_UNKNOWN',
// proper: 'PROPER_UNKNOWN',
// reciprocity: 'RECIPROCITY_UNKNOWN',
// tense: 'TENSE_UNKNOWN',
// voice: 'VOICE_UNKNOWN'
// },
// dependencyEdge: {
// headTokenIndex: 1,
// label: 'NSUBJ'
// },
// lemma: 'contribution'
// },
// // ...
// ]
// }
});
Expand Down
12 changes: 6 additions & 6 deletions packages/datastore/src/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function Query(scope, namespace, kinds) {
*
* *To filter by ancestors, see {module:datastore/query#hasAncestor}.*
*
* @resource [Datastore Filters]{@link https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Filters}
* @resource [Datastore Filters]{@link https://cloud.google.com/datastore/docs/concepts/queries#datastore-property-filter-nodejs}
*
* @param {string} property - The field name.
* @param {string=} operator - Operator (=, <, >, <=, >=). Default: `=`
Expand Down Expand Up @@ -119,7 +119,7 @@ Query.prototype.filter = function(property, operator, value) {
/**
* Filter a query by ancestors.
*
* @resource [Datastore Ancestor Filters]{@link https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Ancestor_filters}
* @resource [Datastore Ancestor Filters]{@link https://cloud.google.com/datastore/docs/concepts/queries#datastore-ancestor-query-nodejs}
*
* @param {Key} key - Key object to filter by.
* @return {module:datastore/query}
Expand All @@ -136,7 +136,7 @@ Query.prototype.hasAncestor = function(key) {
* Sort the results by a property name in ascending or descending order. By
* default, an ascending sort order will be used.
*
* @resource [Datastore Sort Orders]{@link https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Sort_orders}
* @resource [Datastore Sort Orders]{@link https://cloud.google.com/datastore/docs/concepts/queries#datastore-ascending-sort-nodejs}
*
* @param {string} property - The property to order by.
* @param {object=} options - Options object.
Expand Down Expand Up @@ -200,7 +200,7 @@ Query.prototype.select = function(fieldNames) {
/**
* Set a starting cursor to a query.
*
* @resource [Query Cursors]{@link https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Query_cursors}
* @resource [Query Cursors]{@link https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets}
*
* @param {string} cursorToken - The starting cursor token.
* @return {module:datastore/query}
Expand Down Expand Up @@ -238,7 +238,7 @@ Query.prototype.end = function(end) {
/**
* Set a limit on a query.
*
* @resource [Query Limits]{@link https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Retrieving_results}
* @resource [Query Limits]{@link https://cloud.google.com/datastore/docs/concepts/queries#datastore-limit-nodejs}
*
* @param {number} n - The number of results to limit the query to.
* @return {module:datastore/query}
Expand All @@ -255,7 +255,7 @@ Query.prototype.limit = function(n) {
/**
* Set an offset on a query.
*
* @resource [Query Offsets]{@link https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Retrieving_results}
* @resource [Query Offsets]{@link https://cloud.google.com/datastore/docs/concepts/queries#datastore-limit-nodejs}
*
* @param {number} n - The offset to start from after the start cursor.
* @return {module:datastore/query}
Expand Down
74 changes: 4 additions & 70 deletions packages/language/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,7 @@ language.detectEntities('Stephen of Michigan!', function(err, entities) {
// }
// ]
// },
// {
// name: 'Michigan',
// type: 'LOCATION',
// metadata: {
// mid: '/m/04rrx',
// wikipedia_url: 'http://en.wikipedia.org/wiki/Michigan'
// },
// salience: 0.26907116174697876,
// mentions: [
// {
// text: {
// content: 'Michigan',
// beginOffset: -1
// },
// type: 'PROPER'
// }
// ]
// }
// // ...
// ]
});

Expand All @@ -69,8 +52,8 @@ document.detectSentiment(function(err, sentiment) {
});

// Parse the syntax of the document.
document.annotate(function(err, annotations) {
// annotations = {
document.annotate(function(err, annotation) {
// annotation = {
// language: 'en',
// sentiment: {
// magnitude: 0.30000001192092896,
Expand Down Expand Up @@ -131,56 +114,7 @@ document.annotate(function(err, annotations) {
// },
// lemma: 'contribution'
// },
// {
// text: {
// content: 'welcome',
// beginOffset: -1
// },
// partOfSpeech: {
// tag: 'VERB',
// aspect: 'ASPECT_UNKNOWN',
// case: 'CASE_UNKNOWN',
// form: 'FORM_UNKNOWN',
// gender: 'GENDER_UNKNOWN',
// mood: 'INDICATIVE',
// number: 'NUMBER_UNKNOWN',
// person: 'PERSON_UNKNOWN',
// proper: 'PROPER_UNKNOWN',
// reciprocity: 'RECIPROCITY_UNKNOWN',
// tense: 'PRESENT',
// voice: 'VOICE_UNKNOWN'
// },
// dependencyEdge: {
// headTokenIndex: 1,
// label: 'ROOT'
// },
// lemma: 'welcome'
// },
// {
// text: {
// content: '!',
// beginOffset: -1
// },
// partOfSpeech: {
// tag: 'PUNCT',
// aspect: 'ASPECT_UNKNOWN',
// case: 'CASE_UNKNOWN',
// form: 'FORM_UNKNOWN',
// gender: 'GENDER_UNKNOWN',
// mood: 'MOOD_UNKNOWN',
// number: 'NUMBER_UNKNOWN',
// person: 'PERSON_UNKNOWN',
// proper: 'PROPER_UNKNOWN',
// reciprocity: 'RECIPROCITY_UNKNOWN',
// tense: 'TENSE_UNKNOWN',
// voice: 'VOICE_UNKNOWN'
// },
// dependencyEdge: {
// headTokenIndex: 1,
// label: 'P'
// },
// lemma: '!'
// }
// // ...
// ]
// }
});
Expand Down
Loading

0 comments on commit 81b5bd1

Please sign in to comment.