File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Script to discover potential vocabulary terms from Vale output
3+ # Usage: ./discover-vocabulary.sh [file-pattern]
4+
5+ set -e
6+
7+ PATTERN=${1:- " **/*.mdx" }
8+ OUTPUT_FILE=" .vale/vocabulary-candidates.txt"
9+
10+ echo " 🔍 Discovering vocabulary candidates from Vale spelling errors..."
11+ echo " Pattern: $PATTERN "
12+ echo " "
13+
14+ # Run Vale and extract spelling error words
15+ vale --no-exit $PATTERN 2>&1 | \
16+ grep " Vale.Spelling" | \
17+ sed -n " s/.*Did you really mean '\([^']*\)'.*/\1/p" | \
18+ sort | uniq -c | sort -nr > " $OUTPUT_FILE "
19+
20+ if [ -s " $OUTPUT_FILE " ]; then
21+ echo " Found vocabulary candidates in $OUTPUT_FILE :"
22+ echo " "
23+ head -20 " $OUTPUT_FILE "
24+ echo " "
25+ echo " Review these terms and add appropriate ones to:"
26+ echo " - .vale/styles/config/vocabularies/Mintlify/accept.txt (if valid)"
27+ echo " - .vale/styles/config/vocabularies/Mintlify/reject.txt (if misspellings)"
28+ echo " "
29+ echo " To clean up this file: rm $OUTPUT_FILE "
30+ else
31+ echo " ✅ No vocabulary issues found!"
32+ rm -f " $OUTPUT_FILE "
33+ fi
You can’t perform that action at this time.
0 commit comments