Skip to content

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

Merge branch 'master' of https://github.com/Automattic/harper into just-addnoun-refactor

hippietraila78816bf3a8b
diff --cc justfile
index f887f5a3c,fa40f5298..e4359371e
--- a/justfile
+++ b/justfile
@@@ -234,17 -243,12 +243,21 @@@ addnoun noun
exit 0
fi
- # 'M', possessive -'s suffix for both common and proper nouns
++ # 'M': possessive -'s suffix for both common and proper nouns
+ flags='M'
+
- # 'S', plural -(e)s suffix only for common nouns (not capitalized)
- if [[ "{{noun}}" =~ ^[a-z] ]]; then
- flags+='S'
++ # If the first letter is uppercase, treat it as a proper noun
+ if [[ "{{noun}}" =~ ^[A-Z] ]]; then
- echo "{{noun}}/2M" >> $DICT_FILE
++ # '2': proper noun, usually no plural
++ flags+='2'
+ else
- echo "{{noun}}/SM" >> $DICT_FILE
++ # '1': (common) singular noun, 'S': plural -(e)s
++ flags+='1S'
fi
+ # Echo the noun with its flags to the dictionary file
+ echo "{{noun}}/$flags" >> $DICT_FILE
+
# Search Harper's curated dictionary for a specific word
searchdictfor word:
cargo run --bin harper-cli -- words | rg {{word}}