I'm writing a program (Cocoa, Obj-C) where I need to classify words by their part of speech. I know this probably needs to be done via enums and typedefs but am unable to figure out how to get it all working.
Where are some good examples of how they work? I'm having problems understanding the usage difference between X and Y in the following:
enum X {noun, adjective, verb} Y;
Also, "google" for instance, can be a noun or a verb, how would I set that up and test it?
partOfSpeech theWordGoogle = noun & verb;
if (theWordGoogle == noun)
// do something
if (theWordGoogle == verb)
// do something else
etc. Any pointers in the right direction would be helpful.
Where are some good examples of how they work? I'm having problems understanding the usage difference between X and Y in the following:
enum X {noun, adjective, verb} Y;
Also, "google" for instance, can be a noun or a verb, how would I set that up and test it?
partOfSpeech theWordGoogle = noun & verb;
if (theWordGoogle == noun)
// do something
if (theWordGoogle == verb)
// do something else
etc. Any pointers in the right direction would be helpful.