45#include <lal/graphs/rooted_tree.hpp>
46#include <lal/linarr/chunking/chunk.hpp>
47#include <lal/linarr/chunking/chunk_sequence.hpp>
60template <
class arrangement_t>
71 m_n(rt.get_num_nodes())
84 linarr::chunk_sequence& get_chunk_sequence() noexcept {
111 bool head_found =
false;
113 for (
node u : c.get_nodes()) {
122 c.set_parent_node(v);
Basic algorithms existent in every definition of chunking.
Definition generic.hpp:61
const linarr::chunk_sequence & get_chunk_sequence() const noexcept
Returns a constant reference to the chunk sequence m_sequence.
Definition generic.hpp:79
const uint64_t m_n
Number of vertices of the tree.
Definition generic.hpp:147
const arrangement_t m_arr
Linear arrangement.
Definition generic.hpp:145
chunks_generic(const graphs::rooted_tree &rt, const arrangement_t &arr) noexcept
Constructor.
Definition generic.hpp:68
linarr::chunk_sequence m_sequence
The sequence of chunks obtained.
Definition generic.hpp:150
void set_chunk_index(const node u, const std::size_t i) noexcept
Sets the chunk index of node u to index i.
Definition generic.hpp:104
void set_parent_chunk(linarr::chunk &c) noexcept
Set the parent node of a chunks.
Definition generic.hpp:109
linarr::chunk & last_chunk() noexcept
Returns a reference to the last chunk in the sentence.
Definition generic.hpp:95
std::size_t node_to_chunk(const node u) const noexcept
Returns the chunk index of node u.
Definition generic.hpp:100
virtual ~chunks_generic() noexcept
Destructor.
Definition generic.hpp:76
linarr::chunk_sequence && retrieve_chunk_sequence() noexcept
Moves the chunk sequence m_sequence.
Definition generic.hpp:89
const graphs::rooted_tree & m_rt
Input rooted tree.
Definition generic.hpp:143
uint64_t get_in_degree(const node u) const noexcept
Returns the in-degree of a node.
Definition directed_graph.hpp:427
Rooted tree graph class.
Definition rooted_tree.hpp:109
node get_parent_node(const node u) const noexcept
Parent vertex of a node.
Definition rooted_tree.hpp:782
Chunk sequence of a syntactic dependency tree.
Definition chunk_sequence.hpp:107
std::size_t get_chunk_index(const node u) const noexcept
Returns the chunk index of node u.
Definition chunk_sequence.hpp:186
std::size_t size() const noexcept
Returns the number of chunks.
Definition chunk_sequence.hpp:181
Definition of a chunk.
Definition chunk.hpp:64
Main namespace of the library.
Definition basic_types.hpp:48
uint64_t node
Node type. See Node / Vertex page for further details.
Definition basic_types.hpp:51