11-18-2003
2,
0
Join Date: Nov 2003
Last Activity: 18 November 2003, 3:24 PM EST
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
spelling check program
hi, all
well, it's about spelling check,
give a list of words as command line parameters and determine if they are in the dictionary.
> myDictionary hello helloi
hello is in the dictionary
helloi is not.
if spell command is not allowed to use.
could i use grep -c in this way? if the count number of match is equal to 0, then it's misspelled.
case $# in
*)
for w in $*
do
if {test grep -c "$w" /usr/share/dict/words -ne 0;}
echo "...";
else {test grep -c "$w" /usr/share/dict/words -eq 0;}
echo "...";
fi
done
thank u in advance
Tracy