
im having problem with this Haskell functions female, male :: String -> Bool for finding out the gender for a given name which can be inferred from the title. For example, gender> female "Ms. Green" True gender> female "King Arthur" False gender> male "Mr. Scrooge" True gender> female "Miss Beatrix Potter" True

B1lal wrote:
im having problem with this Haskell functions female, male :: String -> Bool
for finding out the gender for a given name which can be inferred from the title.
Are you trying to implement it? Have you tried Data.List.isPrefixOf? Are you aware of just how many different titles there are in the world, both gender-specific and non-gender-specific (although admittedly fewer and less ambiguous than it is for names)?...Probably some of them will appear after someone's name rather than before, too, and then you get to play with fun contradictory things like "Madam So-and-so, Prince of Wales". This smells like a fishy thing to do, I suppose it's like homework rather than the real world...? P.S. gender discrimination! :-P -Isaac

On Wed, Jul 22, 2009 at 07:21:56PM +0100, B1lal wrote:
im having problem with this Haskell functions female, male :: String -> Bool
for finding out the gender for a given name which can be inferred from the title.
For example,
gender> female "Ms. Green"
True
gender> female "King Arthur"
False
gender> male "Mr. Scrooge"
True
gender> female "Miss Beatrix Potter"
True
What have you tried so far? What specifically are you having problems with? This sounds a lot like a homework problem; we are happy to help you with specific problems but in general we won't do your homework for you. -Brent
participants (4)
-
B1lal
-
Brent Yorgey
-
Felipe Lessa
-
Isaac Dupree