|
void | init (const std::size_t n) noexcept |
| Initializes this chunk sequence.
|
|
const chunk & | operator[] (const std::size_t i) const noexcept |
| The i-th chunk.
|
|
chunk & | operator[] (const std::size_t i) noexcept |
| The i-th chunk.
|
|
void | push_chunk () noexcept |
| Adds a new chunk to the collection.
|
|
void | push_chunk (const node u) noexcept |
| Adds a new chunk to the collection.
|
|
std::size_t | size () const noexcept |
| Returns the number of chunks.
|
|
std::size_t | get_chunk_index (const node u) const noexcept |
| Returns the chunk index of node u.
|
|
const_iterator | begin () const noexcept |
| A pointer to the beginning of the chunk sequence.
|
|
iterator | begin () noexcept |
| A pointer to the beginning of the chunk sequence.
|
|
const_iterator | end () const noexcept |
| A pointer to the ending of the chunk sequence.
|
|
iterator | end () noexcept |
| A pointer to the ending of the chunk sequence.
|
|
const std::vector< chunk > & | get_chunks () const noexcept |
| The sequence of chunks.
|
|
Chunk sequence of a syntactic dependency tree.
This can be seen as the ordered sequence of chunks obtained from applying a chunking algorithm. The sequence is ordered because the first chunk (at index 0) is the leftmost chunk in the ordering of the nodes. For instance, we may have the following tree (in the head vector format – see Head vector),
2 5 2 5 0 9 9 9 10 5
The chunks obtained could be (there are other ways to obtain chunks) the follownig
|-------|-----|----------|---|
| 2 5 2 | 5 0 | 9 9 9 10 | 5 |
|-------|-----|----------|---|
0 1 2 3
and so the first chunk has index 0, the second chunk index 1, and so on. Use
const chunk& c0 = chunks[0];
const chunk& c1 = chunks[1];
Chunk sequence of a syntactic dependency tree.
Definition chunk_sequence.hpp:107
const std::vector< chunk > & get_chunks() const noexcept
The sequence of chunks.
Definition chunk_sequence.hpp:213
Definition of a chunk.
Definition chunk.hpp:64
Nodes can be queried for their chunk index with method get_chunk_index. Since in the tree example the nodes are distributed from left to right, the chunk indices are the following (left column: nodes, right column: chunk index).
0: 0
1: 0
2: 0
3: 1
4: 1
5: 2
6: 2
7: 2
8: 2
9: 3