pub struct Paragraph {
pub events: Vec<(String, Context)>,
pub relations: Vec<Option<RstRelation>>,
pub salience: Salience,
pub category: Option<RhetoricalCategory>,
}Expand description
A paragraph in a document plan — a group of related events rendered together.
Fields§
§events: Vec<(String, Context)>The events in this paragraph, in render order.
relations: Vec<Option<RstRelation>>Optional rhetorical relation for each event. relations[i] describes
the relation between events[i] and events[i-1]. relations[0]
is conventionally None (no predecessor within the paragraph).
Same length as events.
salience: SalienceThe highest salience in this paragraph, used for ordering.
category: Option<RhetoricalCategory>Rhetorical category, when the plan was built with
GroupingStrategy::ByAction. None for entity-grouped plans.
Implementations§
Source§impl Paragraph
impl Paragraph
pub fn new() -> Self
Sourcepub fn push(&mut self, key: String, ctx: Context, salience: Salience)
pub fn push(&mut self, key: String, ctx: Context, salience: Salience)
Push an event with no rhetorical relation (None).
Sourcepub fn push_with_relation(
&mut self,
key: String,
ctx: Context,
salience: Salience,
relation: Option<RstRelation>,
)
pub fn push_with_relation( &mut self, key: String, ctx: Context, salience: Salience, relation: Option<RstRelation>, )
Push an event with an optional RST relation to its predecessor.
The relation describes how this event relates to the immediately
preceding event in the same paragraph. Pass None when there is
no predecessor or when the rhetorical link is unknown.