Skip to content

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

refactor: add comments to `just addnoun` and tweak logic

hippietrail74f5f6054731
diff --git a/justfile b/justfile
index 924762344..f887f5a3c 100644
--- a/justfile
+++ b/justfile
@@ -234,12 +234,17 @@ addnoun noun:
exit 0
fi
- if [[ "{{noun}}" =~ ^[A-Z] ]]; then
- echo "{{noun}}/M" >> $DICT_FILE
- else
- echo "{{noun}}/SM" >> $DICT_FILE
+ # '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'
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}}