Thread: IDEA: Spelling Checker

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

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    a dictionary would really help matters...
    but i don't know of any free ones

  3. #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.
    Last edited by fletch; 08-17-2002 at 03:16 PM.
    "Logic is the art of going wrong with confidence."
    Morris Kline

  4. #4
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    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.

  5. #5
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    forgot to mention that you have to change the input filename depending on the file.

  6. #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

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    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).
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

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

  9. #9
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    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.

  10. #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?
    Last edited by fletch; 08-17-2002 at 09:49 PM.
    "Logic is the art of going wrong with confidence."
    Morris Kline

  11. #11
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    Originally posted by fletch

    BTW, what's a modamater?
    i dunno
    what's the matta wit you? *groans*

  12. #12
    Registered User fletch's Avatar
    Join Date
    Jul 2002
    Posts
    176
    Originally posted by ygfperson
    what's the matta wit you? *groans*
    nuttin'
    "Logic is the art of going wrong with confidence."
    Morris Kline

  13. #13
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    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

  14. #14
    Registered User fletch's Avatar
    Join Date
    Jul 2002
    Posts
    176
    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.
    Last edited by fletch; 08-17-2002 at 11:21 PM.
    "Logic is the art of going wrong with confidence."
    Morris Kline

  15. #15
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

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