Skip to content

Positions

All the analysis resources, whether document analysis, document classification or information extraction, return the positions of the blocks of text corresponding to each information discovered by the analysis.
For example:

  • The deep linguistic analysis resource returns the positions of all the subdivisions of the text: paragraphs, sentences, phrases, tokens and atoms.
  • The keyphrase extraction resource returns the positions of main sentences, main phrases, main concepts and main lemmas.
  • The classification resources return the positions of the parts of the text that triggered categorization rules.

All these positions refer to blocks of the analyzed text, that is the content property of the data object.

The starting position is returned in the start property and the ending position in the end property.

The value of the start property is the zero-based index of the first character of the block.
For example, if a text begins with:

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

the start position of phrase of all time is 54:


Michael Jordan was one of the best basketball players of all time.
                                                      ↑
01234567890123456789012345678901234567890123456789012345678901234567890
0         1         2         3         4         5         6         7

The value of the end position is the zero-based index of the first character after the text block. In the example case above, the end position of the phrase is 65:


Michael Jordan was one of the best basketball players of all time.
                                                                 ↑
01234567890123456789012345678901234567890123456789012345678901234567890
0         1         2         3         4         5         6         7