spell checker program


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting spell checker program
# 1  
Old 05-20-2005
Question spell checker program

2.I need shell script to list all the 'words' in a
given file (text) that are not listed in a specified
dictionary. Let us call this utility 'spell-check'.
'spell-check' will be called as follows.

$ spell-check letter
Lucent
UNIX
UNIX
OS
a
$

dictionary words are listed in lower case. Thus 'spell-check'
will have to convert words in its input to lower case before
looking up the dictionary. However, when displaying possible
misspellings, words should be printed as they appear in input.
'spell-check' should take the path for the dictionary from
the environment variable SPELL_CHECK_DICT.

'spell-check' should treat any *sequence of letters* as a word.
Digits, whitespace, punctuation characters will act as delimiters.

It should be possible to use 'spell-check' in a pipe as:-

$ cat letter | spell-check | sort
a
Lucent
OS
UNIX
UNIX
$
I have a program
$ spell-check()
for NAME in (cat $1)
do
if grep -i-s $NAME $SPELL_CHECK_DICT
then
else
echo $NAME
fi
done
# 2  
Old 05-20-2005
I must be missing something. Most unix systems have spell. This provides exactly what you want.

Ask your sysadmin if your system has spell installed, or maybe ask to have it installed if one is available.
usage
Code:
spell textfile

# 3  
Old 05-21-2005
Exactly - why rewrite commands unless it's homework.

Please read the rules.

This...
Quote:
dictionary words are listed in lower case. Thus 'spell-check'
will have to convert words in its input to lower case before
looking up the dictionary. However, when displaying possible
misspellings, words should be printed as they appear in input.
'spell-check' should take the path for the dictionary from
the environment variable SPELL_CHECK_DICT.

'spell-check' should treat any *sequence of letters* as a word.
Digits, whitespace, punctuation characters will act as delimiters.

It should be possible to use 'spell-check' in a pipe as:-
...is just a list of requirements taken from an assignment sheet.

Thread closed.

Thanks,
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Debian

Getting a better spell checker

Guys I am new to Linux in general and want to know what is the use of the following files-: /usr/share/dict/words /usr/share/dict/words.pre-dictionaries-common Are they used by the spell checker to find potential typos ? If so are there any better larger word lists out there ? I am sure... (2 Replies)
Discussion started by: sreyan32
2 Replies

2. Shell Programming and Scripting

Help with Bash Shell Script Spell Checker program.

I have a majority of this problem done but seem to be struggling on the last couple of steps. Here is the whole problem to help you guys get a better understanding. Write a shell script that implements a simple spell checker. The filename you will use for your script will be your Z-id followed... (1 Reply)
Discussion started by: DsmRacer2k14
1 Replies

3. Homework & Coursework Questions

spell checker script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: When "niuspell" is invoked from the command line it reads "file" and checks it for spelling of the words it... (1 Reply)
Discussion started by: Jeffthrow5
1 Replies

4. Homework & Coursework Questions

Unix Spell Checker Assignment

hello, im a new member to the forum and im doing a assignment for unix command and we have to make a spell checker and im a little confused about the directions .. ill post them below and continue.. Northern Illinois University CSCI 330-Unix Command Write a shell script that implements a... (1 Reply)
Discussion started by: bravens52
1 Replies

5. Shell Programming and Scripting

Need your help for the spell checker in unix or python

Hi, Want to know is there any command to correct the spelling using unix or python? Unix command "spell" will give only the list of the incorrect words . But i want the output along with the corrected word . Thanks in advance (1 Reply)
Discussion started by: vini
1 Replies

6. Shell Programming and Scripting

spell check program

hi, i need to write a spell check program in bash to find all possible spelling errors in a file or a number of files taken as input using usr/dict/words. whenever the program encounters a spelling error, it must state the line number at which the incorrect spelling has occured and... (1 Reply)
Discussion started by: kratos.
1 Replies

7. Shell Programming and Scripting

Shell Sript - Spell Checker Assign

Hi Folks. I am currently working on a script that has to spell check a file and print the output to the screen in 2 columns like this. INCORRECT CORRECTION whio who weahter weather The file will allow the user to override the ispell command and save any... (9 Replies)
Discussion started by: ccfc1986
9 Replies

8. UNIX for Advanced & Expert Users

spell

Hi, I found the following line in a shell script. $spell -a < $filename | \ grep -v '@(#)' | sed "s/\'//g" | \ awk '{ if (length($0) > 15 && length($2) > 2) print $2 }' | \ grep -vif $okaywords | \ grep ']' | grep -v ']' | sort -u | \ sed 's/^/ /' > $tempout can... (2 Replies)
Discussion started by: ravi raj kumar
2 Replies

9. Post Here to Contact Site Administrators and Moderators

Spell Check

Administrator/Moderators, I would like to put forth a request rather a suggestion in other words. How about the inclusion of 'SPELL CHECK' tool along with existing submit reply and preview post tools? I believe that would be very much helpful in understanding questions clearly deprived of... (2 Replies)
Discussion started by: matrixmadhan
2 Replies
Login or Register to Ask a Question

Featured Tech Videos