Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

refactor: more nominal->noun

hippietrailfb734ba31013
diff --git a/harper-core/src/linting/lint_group.rs b/harper-core/src/linting/lint_group.rs
index 92ec0f976..d741f577d 100644
--- a/harper-core/src/linting/lint_group.rs
+++ b/harper-core/src/linting/lint_group.rs
@@ -37,7 +37,7 @@ use super::pique_interest::PiqueInterest;
use super::plural_conjugate::PluralConjugate;
use super::possessive_your::PossessiveYour;
use super::pronoun_contraction::PronounContraction;
-use super::proper_nominal_capitalization_linters;
+use super::proper_noun_capitalization_linters;
use super::repeated_words::RepeatedWords;
use super::sentence_capitalization::SentenceCapitalization;
use super::somewhat_something::SomewhatSomething;
@@ -198,7 +198,7 @@ impl LintGroup {
}
out.merge_from(&mut phrase_corrections::lint_group());
- out.merge_from(&mut proper_nominal_capitalization_linters::lint_group(
+ out.merge_from(&mut proper_noun_capitalization_linters::lint_group(
dictionary.clone(),
));
out.merge_from(&mut closed_compounds::lint_group());
diff --git a/harper-core/src/linting/mod.rs b/harper-core/src/linting/mod.rs
index 223f14733..e04df095b 100644
--- a/harper-core/src/linting/mod.rs
+++ b/harper-core/src/linting/mod.rs
@@ -44,7 +44,7 @@ mod pique_interest;
mod plural_conjugate;
mod possessive_your;
mod pronoun_contraction;
-mod proper_nominal_capitalization_linters;
+mod proper_noun_capitalization_linters;
mod repeated_words;
mod sentence_capitalization;
mod somewhat_something;
diff --git a/harper-core/src/linting/proper_nominal_capitalization_linters.rs b/harper-core/src/linting/proper_noun_capitalization_linters.rs
similarity index 100%
rename from harper-core/src/linting/proper_nominal_capitalization_linters.rs
rename to harper-core/src/linting/proper_noun_capitalization_linters.rs
diff --git a/harper-core/src/linting/use_genitive.rs b/harper-core/src/linting/use_genitive.rs
index 9674464f8..83be96161 100644
--- a/harper-core/src/linting/use_genitive.rs
+++ b/harper-core/src/linting/use_genitive.rs
@@ -86,7 +86,7 @@ mod tests {
use super::UseGenitive;
#[test]
- fn catches_adjective_nominal() {
+ fn catches_adjective_noun() {
assert_suggestion_result(
"What are there big problems?",
UseGenitive::default(),
@@ -95,7 +95,7 @@ mod tests {
}
#[test]
- fn catches_just_nominal() {
+ fn catches_just_noun() {
assert_suggestion_result(
"What are there problems?",
UseGenitive::default(),
diff --git a/harper-core/tests/run_tests.rs b/harper-core/tests/run_tests.rs
index 6d30e126a..78819757c 100644
--- a/harper-core/tests/run_tests.rs
+++ b/harper-core/tests/run_tests.rs
@@ -40,7 +40,7 @@ create_test!(issue_109_ext.md, 0);
create_test!(chinese_lorem_ipsum.md, 2);
create_test!(obsidian_links.md, 2);
create_test!(issue_267.md, 0);
-create_test!(proper_nominal_capitalization.md, 2);
+create_test!(proper_noun_capitalization.md, 2);
create_test!(amazon_hostname.md, 0);
create_test!(issue_159.md, 1);
create_test!(issue_358.md, 0);
diff --git a/harper-core/tests/test_sources/proper_nominal_capitalization.md b/harper-core/tests/test_sources/proper_noun_capitalization.md
similarity index 100%
rename from harper-core/tests/test_sources/proper_nominal_capitalization.md
rename to harper-core/tests/test_sources/proper_noun_capitalization.md
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.md
index c274f15bf..843fdb4d9 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
@@ -53,12 +53,12 @@ All you have to do is add a line to `harper-core/src/linting/phrase_corrections.
This method also covers more complex cases, like if one of the words contains capitalization or the phrase is split by a line break.
-Similarly, if you just want Harper to enforce proper capitalization of a multi-token proper noun (like "Tumblr Blaze") you just need to add an entry to `harper-core/src/linting/proper_nominal_capitalization_linters.rs`.
+Similarly, if you just want Harper to enforce proper capitalization of a multi-token proper noun (like "Tumblr Blaze") you just need to add an entry to `harper-core/src/linting/proper_noun_capitalization_linters.rs`.
```rust
group.add(
"TumblrNames",
- Box::new(ProperNominalCapitalizationLinter::new(
+ Box::new(ProperNounCapitalizationLinter::new(
SequencePattern::default()
.t_aco("Tumblr")
.then_whitespace()