Skip to content

Get text

The DIS object provides a number of methods to get the text of the subdivisions that the disambiguation identified.

These methods are listed in the following table.

Subdivision type Method
Entire document getText
Section getSectionText
Paragraph getParagraphText
Sentence getSentenceText
Clause getClauseText
Phrase getPhraseText
Token getTokenText

For example, considering the following text:

Michael Jordan was one of the best basketball players of all time.

this statement:

var tokenText = DIS.getTokenText(6);

sets the tokenText variable to the text (the) of the 7th subdivision in the sequence of tokens and atoms identified by disambiguation.
This other statement:

var phraseText = DIS.getPhraseText(3);

sets the phraseText variable to the text (of all the time) of the fourth phrase.

The getText method has no arguments, while all the other methods share this syntax:

DIS.method(index)

where:

  • method is the method used to get the subdivisions text.
  • index is the integer number representing the zero-based index of a specific text subdivision in the sequence of all the subsequent subdivisions of the same type that the disambiguation identified.