spell check program


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting spell check program
# 1  
Old 03-01-2009
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 underline the word along with the entire life

for example,

11 --- apple apple applle (underlined) apple


i would appreciate any suggestions.

thank you

Last edited by kratos.; 03-01-2009 at 07:20 PM..
# 2  
Old 03-01-2009
not exactly what you want, but hope can help you some.

Code:
#!/usr/bin/perl
use strict;
my %hash=('happy',1,'hello',1,'are',1,'you',1,'first',1,'talk',1);
open FH,"<a.txt";
while(<FH>){
  chomp;
	my @tmp=split(/ +/,$_);
	map {(exists $hash{$_})?print $_," ":print "<",$_,"> " } @tmp; 
	print "\n";
}
close FH;
__END__
a.txt
Are you happy?
Is it the first time that you come here?

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Spell Check

I have this assignment and I am not sure how to start it, I am new any help will be appreciated.... (BASH) Let us say a test is conducted to assess the typing speed for applicants. We need to count # of correctly spelled words and penalize for incorrectly spelled words. score = (# of... (1 Reply)
Discussion started by: shilling
1 Replies

3. Shell Programming and Scripting

bash script to check if a program is running

I'm a bit new to bash programming and I was assigned the job of writing a script that will check to see if a program server is running and to restart the program if it is not up. The script is supposed to check the program every hour (which I have looked up and I believe I know how to do) and send... (3 Replies)
Discussion started by: mcknz
3 Replies

4. Shell Programming and Scripting

Spell Check in MS Word using PERL OLE

Hi, I am trying automate couting number of spell and typo errors in MS Word document using perl script. In perl script, i am using Win32::OLE module of perl to read MS word document. Can anybody tell me are there any modules available in perl which can be imported into my script to... (0 Replies)
Discussion started by: 123an
0 Replies

5. UNIX for Dummies Questions & Answers

spell check

# cat wrong.txt thiis is going to be wrong words containing file # aspell list < wrong.txt thiis I want to check only one word and see the first suggestions ("this" in this case). something like... aspell list --one-word thiis --suggest (5 Replies)
Discussion started by: shantanuo
5 Replies

6. Programming

how to check memory leak in C program under Unix

Hi, How to detect memory leak in C program under unix ? Thanks (6 Replies)
Discussion started by: useless79
6 Replies

7. Shell Programming and Scripting

Check if a program runs on unix

Hi guys, I had a question last week where I asked how I check from a website hosted on windows if a process is running on on of our unix servers. Vino and Shell Life kindly replied with a perl script: if qm') -gt 0 ] ; then echo "Site is up" else echo "Site is down." # start the... (1 Reply)
Discussion started by: drchris
1 Replies

8. 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

9. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: ksjanakan
2 Replies

10. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: hyo77
2 Replies
Login or Register to Ask a Question