Thread: Please help :( problem on check spelling...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    13

    Unhappy Please help :( problem on check spelling...

    I am using Miracle C.

    I would like to write a program on check spelling...
    I decide to have a word bank and use strcmp... [will it be alright?]

    however, i have a question:
    for example, i have a "eat" & "beat" word in my paragraph,
    if i search for the word "eat",
    will the [eat] include in the 'beat" also counted?

    Are there any sample program or any solution to the above program?
    I would like to have a reference...

    Thank you very much !

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    14
    first of all tell wat are you using as a word bank...
    in memory database, databse, or any text file....
    as far as strcmp is concerned it will also take into account "beat " as well as "eat"...if you simply consider the whole para as once...
    you should rather treat each word separately......

    try googling you ll certainly get a code....

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    13
    oh thanks
    i will try my best to improve my program
    gonna ask u when i have further problems

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    That compiler you're using is horribly broken. If you stick with this one, you stand a fairly good chance that valid C code that should solve your problem will cause your compiler to barf.

    Use a modern compiler that actually works.

    For Windows, I would recommend MinGW or LCC (although I wouldn't recommend their editor).

    Edit: With regard to your problem, you might want to use functions like strcmp(), strstr(), etc. etc..

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    The way your data is structured, stored, and accessed, depends on how powerful and fast, you want or need, your program to be.

    The "eat" and "beat" problem is no problem because a word begins with either

    1) The first char after a space
    2) The first char after a newline
    3) The first char after a page break

    Can't think of any others, atm.

    So eat is a word quite distinct from beat. Your program should not be looking for words inside of other words!

    There are lots of resources on-line, including word lists, and spell checker program info, as well.

    Google yourself up a feast. I believe the stronger programs use a "hash" structure for this, but in a little word checker (for a puzzle program) I wrote, I just used 26 files, one for each letter, with each file in sorted order. A binary search of the array that loads the words, is quite fast.

    I only had to check a very few words, though. Your situation sounds like a more robust solution will be needed.

    We get quite a few complaints on the forum about Miracle C. You might want to also google up a free (and better) C compiler, for use on your program.

    When you have a code problem with something, come on back and post it up. Let us know about your problem, and what it should be doing. That's where this forum is most valuable.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. allegro issues
    By mramazing in forum C++ Programming
    Replies: 1
    Last Post: 01-07-2009, 11:56 PM
  2. HELP!!!!emergency Problem~expert please help
    By unknowppl in forum C++ Programming
    Replies: 9
    Last Post: 08-21-2008, 06:41 PM
  3. HELP!!!!emergency ~expert please help
    By unknowppl in forum C Programming
    Replies: 1
    Last Post: 08-19-2008, 07:35 AM
  4. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  5. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 05:20 AM