pub enum CenteringTransition {
Continue,
Retain,
SmoothShift,
RoughShift,
Null,
}Expand description
Centering transition type between successive utterances.
Transitions describe how the discourse focus shifts (or doesn’t) between utterances. The preference ordering predicts processing difficulty:
CONTINUE > RETAIN > SMOOTH-SHIFT > ROUGH-SHIFTTexts with more CONTINUE transitions are easier to process because they maintain a consistent topic focus.
§Transition Rules
| Transition | Cb(U_n) = Cb(U_{n-1})? | Cb(U_n) = Cp(U_n)? |
|---|---|---|
| CONTINUE | Yes | Yes |
| RETAIN | Yes | No |
| SMOOTH-SHIFT | No | Yes |
| ROUGH-SHIFT | No | No |
§Example
use anno::discourse::centering::CenteringTransition;
// CONTINUE is most coherent
assert!(CenteringTransition::Continue.coherence_score() >
CenteringTransition::Retain.coherence_score());
// Check transition type
assert!(CenteringTransition::Continue.is_continuing());
assert!(CenteringTransition::SmoothShift.is_shifting());Variants§
Continue
Cb(U_n) = Cb(U_{n-1}) AND Cb(U_n) = Cp(U_n). The discourse continues about the same entity, which remains most salient. This is the most coherent transition.
Retain
Cb(U_n) = Cb(U_{n-1}) AND Cb(U_n) != Cp(U_n). Same topic, but another entity is now more salient—signals an upcoming shift.
SmoothShift
Cb(U_n) != Cb(U_{n-1}) AND Cb(U_n) = Cp(U_n). Topic shift to a new entity, which is established as most salient.
RoughShift
Cb(U_n) != Cb(U_{n-1}) AND Cb(U_n) != Cp(U_n). Topic shift, but the new topic isn’t even the most salient entity. This is the least coherent transition.
Null
No Cb exists (discourse-initial or no entity from previous utterance realized).
Implementations§
Source§impl CenteringTransition
impl CenteringTransition
Sourcepub const fn coherence_score(&self) -> f64
pub const fn coherence_score(&self) -> f64
Coherence score for this transition (higher = more coherent).
Sourcepub const fn is_continuing(&self) -> bool
pub const fn is_continuing(&self) -> bool
Is this a continuing transition (same Cb)?
Sourcepub const fn is_shifting(&self) -> bool
pub const fn is_shifting(&self) -> bool
Is this a shifting transition (different Cb)?
Trait Implementations§
Source§impl Clone for CenteringTransition
impl Clone for CenteringTransition
Source§fn clone(&self) -> CenteringTransition
fn clone(&self) -> CenteringTransition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CenteringTransition
Source§impl Debug for CenteringTransition
impl Debug for CenteringTransition
Source§impl Default for CenteringTransition
impl Default for CenteringTransition
Source§fn default() -> CenteringTransition
fn default() -> CenteringTransition
Source§impl<'de> Deserialize<'de> for CenteringTransition
impl<'de> Deserialize<'de> for CenteringTransition
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CenteringTransition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CenteringTransition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for CenteringTransition
Source§impl Hash for CenteringTransition
impl Hash for CenteringTransition
Source§impl PartialEq for CenteringTransition
impl PartialEq for CenteringTransition
Source§fn eq(&self, other: &CenteringTransition) -> bool
fn eq(&self, other: &CenteringTransition) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CenteringTransition
impl Serialize for CenteringTransition
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CenteringTransition
Auto Trait Implementations§
impl Freeze for CenteringTransition
impl RefUnwindSafe for CenteringTransition
impl Send for CenteringTransition
impl Sync for CenteringTransition
impl Unpin for CenteringTransition
impl UnsafeUnpin for CenteringTransition
impl UnwindSafe for CenteringTransition
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more