Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat: add person+case to pronoun, degree to adjective
hippietrail75ac6877626e
diff --git a/harper-core/src/word_metadata.rs b/harper-core/src/word_metadata.rsindex 02bde6a8d..669e52c47 100644--- a/harper-core/src/word_metadata.rs+++ b/harper-core/src/word_metadata.rs@@ -165,10 +165,25 @@ impl NominalData {}}+#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, PartialOrd, Is, Hash)]+pub enum Person {+ First,+ Second,+ Third,+}++#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, PartialOrd, Is, Hash)]+pub enum Case {+ Subject,+ Object,+}+#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, PartialOrd, Eq, Hash, Default)]pub struct PronounData {pub is_plural: Option<bool>,pub is_possessive: Option<bool>,+ pub person: Option<Person>,+ pub case: Option<Case>,}impl PronounData {@@ -177,17 +192,30 @@ impl PronounData {Self {is_plural: self.is_plural.or(other.is_plural),is_possessive: self.is_possessive.or(other.is_possessive),+ person: self.person.or(other.person),+ case: self.case.or(other.case),}}}+#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, PartialOrd, Is, Hash)]+pub enum Degree {+ Positive,+ Comparative,+ Superlative,+}+#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, PartialOrd, Eq, Hash, Default)]-pub struct AdjectiveData {}+pub struct AdjectiveData {+ pub degree: Option<Degree>,+}impl AdjectiveData {/// Produce a copy of `self` with the known properties of `other` set.- pub fn or(&self, _other: &Self) -> Self {- Self {}+ pub fn or(&self, other: &Self) -> Self {+ Self {+ degree: self.degree.or(other.degree),+ }}}diff --git a/packages/web/src/routes/docs/contributors/author-a-rule/+page.md b/packages/web/src/routes/docs/contributors/author-a-rule/+page.mdindex 64eb11b86..c274f15bf 100644--- a/packages/web/src/routes/docs/contributors/author-a-rule/+page.md+++ b/packages/web/src/routes/docs/contributors/author-a-rule/+page.md@@ -58,7 +58,7 @@ Similarly, if you just want Harper to enforce proper capitalization of a multi-t```rustgroup.add("TumblrNames",- Box::new(ProperNounCapitalizationLinter::new(+ Box::new(ProperNominalCapitalizationLinter::new(SequencePattern::default().t_aco("Tumblr").then_whitespace()