1.0.16 • Published 3 years ago

google-ngram v1.0.16

Weekly downloads
35
License
MIT
Repository
github
Last release
3 years ago

google-ngram

A simple package to interact with the Google Books Ngram API.

Version License

a

Example Usage:

const ngram=require('google-ngram')

//simple usage
ngram.getNGram('the').then(r => console.log(r))

//with options
ngram.getNGram('the', {year_start: 1920, corpus: 10}).then(r => console.log(r))

//multiple words
ngram.getNGram('the, and').then(r => console.log(r))

//with wildcard
ngram.getNGram('the *').then(r => console.log(r))

getNGram(Content, Options) => Promise: Array

Content

TypeNotes
StringRequired

Options

TypeParametersDefault ValuesNotes
Object{corpus: int, smoothing: int, year_start: int, year_end: int, case_insensitive: boolean} (all are optional){corpus: 26 (English Corpus), smoothing: 3, year_start: 1800, year_end: 2019, case_insensitive: false}Optional

Parameter Information:

CorpusNumber
English 2019 (Default)26
American English 201928
British English29
English Fiction27
Chinese(Simplified)34
French30

Returned Data:

[
  {
    "ngram": "<word>",
    "parent": "", //used for wildcard
    "type": "NGRAM",
    "timeseries": [
      0.057974955067038536,
      0.057649505138397214,
      0.057653142139315605,
      0.05750594554202897,
      ...
    ]
  }
  ... //for multiple words or wildcard
]
1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago