Skip to content

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

fix: unneeded imports and added new metadata format to affixes

Elijah Potterc589d3007eb9
diff --git a/harper-core/affixes.json b/harper-core/affixes.json
index 5c0fa1431..ab60082af 100644
--- a/harper-core/affixes.json
+++ b/harper-core/affixes.json
@@ -268,12 +268,12 @@
}
],
"adds_metadata": {
- "possessive": true
+ "noun": {
+ "is_possessive": true
+ }
},
"gifts_metadata": {
- "kind": {
- "kind": "Noun"
- }
+ "noun": {}
}
},
"F": {
@@ -337,12 +337,7 @@
"condition": "[^sxzhy]"
}
],
- "adds_metadata": {
- "kind": {
- "kind": "Noun",
- "plural": true
- }
- },
+ "adds_metadata": {},
"gifts_metadata": {}
},
"D": {
@@ -375,12 +370,7 @@
"kind": "Adjective"
}
},
- "gifts_metadata": {
- "kind": {
- "kind": "Noun",
- "is_proper": null
- }
- }
+ "gifts_metadata": {}
},
"G": {
"suffix": true,
@@ -397,16 +387,8 @@
"condition": "[^e]"
}
],
- "adds_metadata": {
- "kind": {
- "kind": "Adjective"
- }
- },
- "gifts_metadata": {
- "kind": {
- "kind": "Verb"
- }
- }
+ "adds_metadata": {},
+ "gifts_metadata": {}
},
"Q": {
"suffix": true,
@@ -487,6 +469,57 @@
],
"adds_metadata": {},
"gifts_metadata": {}
+ },
+ "1": {
+ "suffix": true,
+ "cross_product": true,
+ "replacements": [],
+ "adds_metadata": {},
+ "gifts_metadata": {
+ "kind": {
+ "kind": "Noun"
+ }
+ }
+ },
+ "2": {
+ "suffix": true,
+ "cross_product": true,
+ "replacements": [],
+ "adds_metadata": {},
+ "gifts_metadata": {
+ "noun": {
+ "is_proper": true
+ }
+ }
+ },
+ "3": {
+ "suffix": true,
+ "cross_product": true,
+ "replacements": [],
+ "adds_metadata": {},
+ "gifts_metadata": {
+ "verb": {
+ "is_linking": true
+ }
+ }
+ },
+ "4": {
+ "suffix": true,
+ "cross_product": true,
+ "replacements": [],
+ "adds_metadata": {},
+ "gifts_metadata": {
+ "verb": {}
+ }
+ },
+ "5": {
+ "suffix": true,
+ "cross_product": true,
+ "replacements": [],
+ "adds_metadata": {},
+ "gifts_metadata": {
+ "adjective": {}
+ }
}
}
}
diff --git a/harper-core/src/spell/dictionary.rs b/harper-core/src/spell/dictionary.rs
index 32afe9411..3fc31d2b7 100644
--- a/harper-core/src/spell/dictionary.rs
+++ b/harper-core/src/spell/dictionary.rs
@@ -1,6 +1,6 @@
use blanket::blanket;
-use crate::{Lrc, WordMetadata};
+use crate::WordMetadata;
#[cfg(not(feature = "concurrent"))]
#[blanket(derive(Rc))]
diff --git a/harper-core/src/spell/merged_dictionary.rs b/harper-core/src/spell/merged_dictionary.rs
index e137419f4..c7aec185d 100644
--- a/harper-core/src/spell/merged_dictionary.rs
+++ b/harper-core/src/spell/merged_dictionary.rs
@@ -3,7 +3,7 @@ use std::sync::Arc;
use hashbrown::HashMap;
use super::dictionary::Dictionary;
-use crate::{CharString, Lrc, WordMetadata};
+use crate::{CharString, WordMetadata};
/// A simple wrapper over [`Dictionary`] that allows
/// one to merge multiple dictionaries without copying.