Document

CoreNLP/simple. Document

Class representing a Document

Constructor

new Document(text)

Source:

Create a Document

Parameters:
Name Type Description
text string

Extends

  • Annotable

Methods

(static) fromJSON(data) → {Document}

Source:

Get an instance of Document from a given JSON

Parameters:
Name Type Description
data DocumentJSON

The document data, as returned by CoreNLP API service

Returns:

document - A new Document instance

Type
Document

coref(index) → {CorefChain}

Source:
See:

Get the coreference for a given index

Parameters:
Name Type Description
index number

0-based index of the coref chain list

Returns:
Type
CorefChain

corefs() → {Array.<CorefChain>}

Source:
See:
To Do:
  • Missing implementation
Returns:
Type
Array.<CorefChain>

fromJSON(data) → {Document}

Source:

Update an instance of Document with data provided by a JSON

Parameters:
Name Type Description
data DocumentJSON

The document data, as returned by CoreNLP API service

Returns:

document - The current document instance

Type
Document

sentence(index) → {Sentence}

Source:

Get the sentence for a given index

Parameters:
Name Type Description
index number

The position of the sentence to get

Returns:

sentence - The document sentences

Type
Sentence

sentences() → {Array.<Sentence>}

Source:

Get a list of sentences

Returns:

sentences - The document sentences

Type
Array.<Sentence>

setLanguageISO() → {string}

Source:

Sets the language ISO (given by the pipeline during the annotation process) This is solely to keep track of the language chosen for further analysis

Returns:

text

Type
string

toString() → {string}

Source:

Get a string representation

Returns:

document

Type
string