Moby Dick

The text of Moby Dick by Herman Melville.

Usage

var text = require( '@stdlib/datasets/moby-dick' );

text()

Returns the text of Moby Dick.

var data = text();
// returns [{...},{...},...]

Each array element has the following fields:

  • chapter: chapter number or identifier.
  • title: chapter title (if available; otherwise, empty).
  • text: chapter text.

Examples

var text = require( '@stdlib/datasets/moby-dick' );

var data;
var i;

data = text();
for ( i = 0; i < data.length; i++ ) {
    console.log( 'Character Count: %d', data[ i ].text.length );
}

CLI

Usage

Usage: moby-dick [options]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.
         --format fmt          Output format: 'txt' or 'ndjson'.

Notes

  • The CLI supports two output formats: plain text (txt) and newline-delimited JSON (NDJSON). The default output format is txt.

Examples

$ moby-dick
CONTENTS


ETYMOLOGY.

EXTRACTS (Supplied by a Sub-Sub-Librarian).


CHAPTER 1. Loomings.

...

License

The data files (databases) are licensed under an Open Data Commons Public Domain Dedication & License 1.0 and their contents are licensed under Creative Commons Zero v1.0 Universal. The software is licensed under Apache License, Version 2.0.