C Board  

Go Back   C Board > Community Boards > Contests Board

Reply
 
LinkBack Thread Tools Display Modes
Old 08-17-2002, 08:54 AM   #1
Registered User
 
fletch's Avatar
 
Join Date: Jul 2002
Posts: 176
IDEA: Spelling Checker

I think this came up before, but...

How about a program that checks the spelling of a single word or an entire text file? Entries could be graded on speed, accuracy, how it handles upper and lower case letters, etc. Probably need some sort of 'standard' dictionary (I guess I'll make one if this idea ever comes up).
__________________
"Logic is the art of going wrong with confidence."
Morris Kline
fletch is offline   Reply With Quote
Old 08-17-2002, 11:15 AM   #2
Just because
 
ygfperson's Avatar
 
Join Date: Jan 2002
Posts: 2,502
a dictionary would really help matters...
but i don't know of any free ones
ygfperson is offline   Reply With Quote
Old 08-17-2002, 12:11 PM   #3
Registered User
 
fletch's Avatar
 
Join Date: Jul 2002
Posts: 176
Take a look at Project Gutenberg. A copy of Webster's Unabridged Dictionary can be found at this FTP site. Look for the files named pgwxxxx.xxx. The files have tags for formatting, but I'd be willing to go through and extract the individual words. The only problem I see would be the huge number of words...or perhaps the dictionary could be divided up and it would be up to the contestant to find a way to use the dictionary effectively. On the other hand, maybe a homemade smaller dictionary (couple 100 entries) of commonly used words would be better. A smaller dictionary would be less daunting and maybe attract more contestants...just a thought.
__________________
"Logic is the art of going wrong with confidence."
Morris Kline

Last edited by fletch; 08-17-2002 at 03:16 PM.
fletch is offline   Reply With Quote
Old 08-17-2002, 05:25 PM   #4
Just because
 
ygfperson's Avatar
 
Join Date: Jan 2002
Posts: 2,502
i've written a small c++ program that extracts the text from a file and prints out only the word, without non-alphabet letters. i've only tested this on the 'c' part of the dictionary, but it should work for all of it.
Attached Files
File Type: cpp dict-list.cpp (847 Bytes, 129 views)
ygfperson is offline   Reply With Quote
Old 08-17-2002, 05:42 PM   #5
Just because
 
ygfperson's Avatar
 
Join Date: Jan 2002
Posts: 2,502
forgot to mention that you have to change the input filename depending on the file.
ygfperson is offline   Reply With Quote
Old 08-17-2002, 05:55 PM   #6
Registered User
 
fletch's Avatar
 
Join Date: Jul 2002
Posts: 176
Yeah, I figured that out

Unfortunately, I lack your programming savvy. I was trying to work something out along the same lines as you (except using the standard C string functions - not STL) and not really getting very far very fast. Now I'm using your dict-list.cpp as a crash course in the STL.
__________________
"Logic is the art of going wrong with confidence."
Morris Kline
fletch is offline   Reply With Quote
Old 08-17-2002, 06:46 PM   #7
End Of Line
 
Hammer's Avatar
 
Join Date: Apr 2002
Posts: 6,240
Quote:
I was trying to work something out along the same lines as you (except using the standard C string functions - not STL) and not really getting very far very fast.
For purely educational purposes, here's a C version that will give the same end result as ygfs C++ one. (ygf, feel free to delete this if you think it's roaming OT).
Attached Files
File Type: c junk1.c (600 Bytes, 118 views)
__________________
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Hammer is offline   Reply With Quote
Old 08-17-2002, 07:24 PM   #8
Registered User
 
fletch's Avatar
 
Join Date: Jul 2002
Posts: 176
I now have a 1.18 MB text file dictionary containing 118,964 words. Still needs a little work though - I need to delete duplicate and multiple word entries.

Thanks for the educational opportunity ygf and Hammer!
__________________
"Logic is the art of going wrong with confidence."
Morris Kline
fletch is offline   Reply With Quote
Old 08-17-2002, 09:42 PM   #9
Just because
 
ygfperson's Avatar
 
Join Date: Jan 2002
Posts: 2,502
Quote:
Originally posted by Hammer

For purely educational purposes, here's a C version that will give the same end result as ygfs C++ one. (ygf, feel free to delete this if you think it's roaming OT).
no... that wouldn't be fair.

just letting everyone know who happens to be reading this...
anything related to the topic can be posted inside the IDEA thread. you can also post for the sole purpose of bumping the thread to the top.
ygfperson is offline   Reply With Quote
Old 08-17-2002, 09:46 PM   #10
Registered User
 
fletch's Avatar
 
Join Date: Jul 2002
Posts: 176
ygf,

I just emailed you a dictionary in case this contest ever comes up. It was too big to post here...

BTW, what's a modamater?
__________________
"Logic is the art of going wrong with confidence."
Morris Kline

Last edited by fletch; 08-17-2002 at 09:49 PM.
fletch is offline   Reply With Quote
Old 08-17-2002, 09:57 PM   #11
Just because
 
ygfperson's Avatar
 
Join Date: Jan 2002
Posts: 2,502
Quote:
Originally posted by fletch

BTW, what's a modamater?
i dunno
what's the matta wit you? *groans*
ygfperson is offline   Reply With Quote
Old 08-17-2002, 10:02 PM   #12
Registered User
 
fletch's Avatar
 
Join Date: Jul 2002
Posts: 176
Quote:
Originally posted by ygfperson
what's the matta wit you? *groans*
nuttin'
__________________
"Logic is the art of going wrong with confidence."
Morris Kline
fletch is offline   Reply With Quote
Old 08-17-2002, 10:56 PM   #13
Just because
 
ygfperson's Avatar
 
Join Date: Jan 2002
Posts: 2,502
i checked your dictionary file, and i think there are some words that are out of order, like Zymosimeter and Zymophyte. i'm assuming that when the words are put into correct order, checking for duplicates should get as easy as checking word x with word x+1 for equality. i'll write up a small program to correct these inaccuracies
ygfperson is offline   Reply With Quote
Old 08-17-2002, 11:17 PM   #14
Registered User
 
fletch's Avatar
 
Join Date: Jul 2002
Posts: 176
Quote:
Originally posted by ygfperson
i checked your dictionary file, and i think there are some words that are out of order, like Zymosimeter and Zymophyte. i'm assuming that when the words are put into correct order, checking for duplicates should get as easy as checking word x with word x+1 for equality.
That's the order that they came out of the dictionary in
That's what I did to get rid of the other duplicate entries. Of course that was based on the assumption that the dictionary was in alphabetical order. (Not so) Obviously that was an erroneous assumption. Oh, well...you know what they say about assume.
__________________
"Logic is the art of going wrong with confidence."
Morris Kline

Last edited by fletch; 08-17-2002 at 11:21 PM.
fletch is offline   Reply With Quote
Old 08-17-2002, 11:20 PM   #15
Just because
 
ygfperson's Avatar
 
Join Date: Jan 2002
Posts: 2,502
yeah, well...

everybody makes mistakes, except my 1ghz athlon amd

i loaded every word into memory with the attached program, sorted them, then printed them back out in the correct order. god, i love the stl... imaging trying to write this kind of stuff from scratch.
Attached Files
File Type: cpp dict-memory.cpp (454 Bytes, 111 views)
ygfperson is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
project idea ??? gemini_shooter C Programming 2 06-09-2005 09:56 AM
Have an idea? B0bDole Projects and Job Recruitment 46 01-13-2005 03:25 PM
A little problem about an idea, help please louis_mine C++ Programming 3 09-10-2004 09:52 PM
totally screwed up idea iain A Brief History of Cprogramming.com 9 08-17-2001 12:09 PM


All times are GMT -6. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22