pub enum Number {
Singular,
Dual,
Plural,
Unknown,
}Expand description
Grammatical number (singular, dual, plural).
Number indicates how many entities are being referred to. While English has a simple singular/plural distinction, many languages (including Arabic, Hebrew, Sanskrit, and Ancient Greek) have a dual form for exactly two.
§The Dual Number
The dual is particularly important for Arabic NLP:
كِتَابٌ (kitābun) - one book (singular)
كِتَابَانِ (kitābāni) - two books (dual)
كُتُبٌ (kutubun) - three+ books (plural)For coreference, we treat dual as compatible with plural (a pair of entities can be referred to with plural pronouns in many contexts).
§Cross-Linguistic Distribution
| Language | Has Dual? | Example |
|---|---|---|
| Arabic | Yes | كِتَابَانِ (two books) |
| Hebrew | Yes | יָדַיִם (two hands) |
| Sanskrit | Yes | द्वौ (two) |
| English | No* | “both” (lexical, not grammatical) |
| Japanese | No | 本 (hon) + counter |
*English lost the dual around 1000 CE; Old English had it.
Variants§
Singular
Singular: exactly one entity
The default for most zero pronouns in Arabic, where the dropped subject typically refers to a single previously-mentioned entity.
Dual
Dual: exactly two entities
Important for Arabic, Hebrew, Sanskrit, and other Semitic/Indo-European languages. In Arabic, verb conjugations and noun endings differ for dual vs plural.
Plural
Plural: more than one (or more than two in dual languages)
In languages with dual, plural specifically means “three or more”. In languages without dual, plural means “two or more”.
Unknown
Unknown or ambiguous number
Used when number cannot be determined, e.g., “you” in English (ambiguous singular/plural), or “they” (singular they vs plural).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Number
impl<'de> Deserialize<'de> for Number
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Number, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Number, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Number
impl Serialize for Number
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 Copy for Number
impl Eq for Number
impl StructuralPartialEq for Number
Auto Trait Implementations§
impl Freeze for Number
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnsafeUnpin for Number
impl UnwindSafe for Number
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.