pub struct ShellNoun {
pub lemma: String,
pub class: ShellNounClass,
pub determiner: Option<String>,
pub start: usize,
pub end: usize,
pub full_text: Option<String>,
}Expand description
A shell noun that can refer to abstract antecedents.
Shell nouns are abstract nouns like “problem”, “issue”, “fact” that serve as “conceptual shells” for complex information.
§Research Background
Schmid (2000) identified ~670 shell nouns in English, organized into six semantic classes: factual, linguistic, mental, modal, eventive, circumstantial.
§Example
use anno::discourse::{ShellNoun, ShellNounClass};
let shell = ShellNoun::new("problem", ShellNounClass::Factual)
.with_determiner("this")
.at_span(32, 44);
assert!(shell.is_demonstrative());Fields§
§lemma: StringThe shell noun lemma (e.g., “problem”, “issue”, “fact”)
class: ShellNounClassSemantic class of this shell noun
determiner: Option<String>The determiner used (e.g., “this”, “the”, “such”)
start: usizeStart character offset
end: usizeEnd character offset
full_text: Option<String>The full NP text (e.g., “this problem”)
Implementations§
Source§impl ShellNoun
impl ShellNoun
Sourcepub fn new(lemma: impl Into<String>, class: ShellNounClass) -> ShellNoun
pub fn new(lemma: impl Into<String>, class: ShellNounClass) -> ShellNoun
Create a new shell noun.
Sourcepub fn with_determiner(self, det: impl Into<String>) -> ShellNoun
pub fn with_determiner(self, det: impl Into<String>) -> ShellNoun
Set the determiner.
Sourcepub fn with_full_text(self, text: impl Into<String>) -> ShellNoun
pub fn with_full_text(self, text: impl Into<String>) -> ShellNoun
Set full text.
Sourcepub fn is_demonstrative(&self) -> bool
pub fn is_demonstrative(&self) -> bool
Is this a demonstrative shell noun (e.g., “this problem”)?
Sourcepub fn typical_antecedent_types(&self) -> &[ReferentType]
pub fn typical_antecedent_types(&self) -> &[ReferentType]
Get the typical antecedent types for this shell noun.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ShellNoun
impl<'de> Deserialize<'de> for ShellNoun
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ShellNoun, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ShellNoun, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ShellNoun
impl Serialize for ShellNoun
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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ShellNoun
impl RefUnwindSafe for ShellNoun
impl Send for ShellNoun
impl Sync for ShellNoun
impl Unpin for ShellNoun
impl UnsafeUnpin for ShellNoun
impl UnwindSafe for ShellNoun
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>,
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>
Converts
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>
Converts
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