GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Jun-2004, 11:29
mail_as mail_as is offline
New Member
 
Join Date: Jun 2004
Posts: 8
mail_as is on a distinguished road

How to do word comaparison in C++ ?


I have this question. I have to find a word in the give file and also synonyms of that word in the file. For example, when I find the word "change", I should also be able to find words like "alter", "changing" etc. Any suggestions?
  #2  
Old 13-Jun-2004, 12:35
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,244
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by mail_as
I have this question. I have to find a word in the give file and also synonyms of that word in the file. For example, when I find the word "change", I should also be able to find words like "alter", "changing" etc. Any suggestions?
You need to create a a dictionary database that links the appropriate words together.
__________________

Age is unimportant -- except in cheese
  #3  
Old 13-Jun-2004, 20:26
Max Payne's Avatar
Max Payne Max Payne is offline
Regular Member
 
Join Date: Apr 2004
Location: 3° 08 North 101° 42 East
Posts: 332
Max Payne is a jewel in the roughMax Payne is a jewel in the roughMax Payne is a jewel in the rough
or a hash table.
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds
  #4  
Old 14-Jun-2004, 11:28
tay's Avatar
tay tay is offline
Junior Member
 
Join Date: Jan 2004
Posts: 77
tay will become famous soon enough
Quote:
Originally Posted by mail_as
I have this question. I have to find a word in the give file and also synonyms of that word in the file. For example, when I find the word "change", I should also be able to find words like "alter", "changing" etc. Any suggestions?

i have a assignment almost similar what u question here
not sure is it same as ur 1
but the code not effect , no hash table
just store in vector and compare only
if u want u can take a look
__________________
challenges are make life interesting,
overcome them is make life meaningful.
  #5  
Old 14-Jun-2004, 11:32
aaroncohn's Avatar
aaroncohn aaroncohn is offline
Regular Member
 
Join Date: Feb 2004
Location: Bay Area, CA.
Posts: 564
aaroncohn is a jewel in the roughaaroncohn is a jewel in the roughaaroncohn is a jewel in the rough
Sorry, tay, I don't think that's a valid solution.
__________________
-Aaron
  #6  
Old 14-Jun-2004, 12:32
eXiLe eXiLe is offline
New Member
 
Join Date: Jun 2004
Posts: 10
eXiLe is on a distinguished road
i don't get what exactly mail_as wanna do, so i've nothing to say for now. mail_as pls explain a bit more...
  #7  
Old 14-Jun-2004, 15:32
mail_as mail_as is offline
New Member
 
Join Date: Jun 2004
Posts: 8
mail_as is on a distinguished road
My questions was to do create a search algorithm. I have an input data file and the word to be searched is accepted from the user (change). As and when I search the word in the input file, I also needed to search words with same meaning. So, now I not only search the word change but also words like changes, changing, alter and so one.

Max Payne - What exactly is a hash table?
  #8  
Old 14-Jun-2004, 19:20
Max Payne's Avatar
Max Payne Max Payne is offline
Regular Member
 
Join Date: Apr 2004
Location: 3° 08 North 101° 42 East
Posts: 332
Max Payne is a jewel in the roughMax Payne is a jewel in the roughMax Payne is a jewel in the rough
Quote:
Originally Posted by mail_as
Max Payne - What exactly is a hash table?

Hash table is a data structure like linked list but it has different methods. I had used hash table before to make a English-Malay dictionary before for my school project and thats a long time ago, I don't even remember how it work. Hmm, its just a suggestion, take alook at the data structure books, you may find something.

Ahh, if I'm not mistaken, its a stack of linked list. Somebody correct me if i'm wrong. For my project, each stack node contains the English word and the linked list of the corresponding stack node contains list of word in Malay which is similar to the Englist word, so I can do a search for English-Malay dictionary.
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds
  #9  
Old 14-Jun-2004, 23:44
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,244
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by Max Payne
Hash table is a data structure like linked list but it has different methods.

Kind of a lame description...

When you add something to a hash table you obtain a number from the key value (person's name) to be added to the table. One way is to add the character values mod 1000. This give you an index into the table. Into that index position goes the data record for the person.

You will probably get collisions (index values already used) so you further massage the index by maybe adding 13 until you hit an open position.

Then when looking for that value again, just repeat the above to get the same index and there's your data.
__________________

Age is unimportant -- except in cheese
  #10  
Old 15-Jun-2004, 00:12
Max Payne's Avatar
Max Payne Max Payne is offline
Regular Member
 
Join Date: Apr 2004
Location: 3° 08 North 101° 42 East
Posts: 332
Max Payne is a jewel in the roughMax Payne is a jewel in the roughMax Payne is a jewel in the rough
Quote:
Originally Posted by WaltP
Kind of a lame description...

I feel ashamed
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds
 
 

Recent GIDBlogBelkin Laptop Cooler by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
testing word file "need help" alexandro C Programming Language 2 03-Jun-2004 14:38
word finder (there are problems) small_ticket C Programming Language 0 14-May-2004 15:09
coding a word with a givin factor funnyf C++ Forum 2 13-Jan-2004 08:32

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 12:35.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.