The DIS object
Introduction
The DIS
pre-defined object gives access to the disambiguation results and also allows you to tag or untag text subdivisions.
The DIS
object can be used in the following functions, which are executed after disambiguation:
The functionalities of the DIS
object are exposed through its methods, which can be grouped into these groups:
- Count text subdivisions
- Get the text of the whole document or that of text subdivisions
- Get objects corresponding to text subdivisions to explore their properties
- Get the index of the text subdivision of a certain kind which contains a character at a given position with respect to the document text
- Tag and untag text subdivisions
Text subdivisions: tokens and atoms
The methods of the DIS
object are based on the creation of text subdivisions—with different granularity—operated by disambiguation.
Disambiguation lists atoms immediately after the token they are part of. It's crucial to recognize and account for this feature when iterating through tokens.
For example, given this input text:
Michael Jordan was one of the best basketball players of all time.
disambiguation identifies these 15 units as either tokens or atoms:
Index | Text | Type |
---|---|---|
0 | Michael Jordan | Token |
1 | Michael | Atom |
2 | Jordan | Atom |
3 | was | Token |
4 | one | Token |
5 | of | Token |
6 | the | Token |
7 | best | Token |
8 | basketball players | Token |
9 | basketball | Atom |
10 | players | Atom |
11 | of | Token |
12 | all | Token |
13 | time | Token |
14 | . | Token |