#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Check the Last part


    Hello everyone, I am trying to make a program that identifies words. Ex= The program asks
    Code:
    word=input ("Write a Word")
    The user writes it, for example running, then the program reads for ex if words end==-ing then print ("You wrote a verb") Is there anyway to do this? or Would I have to write a small database, if so, how?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    30
    Rep Power
    2
    I'm a newb but there is a simple solution to this:

    Code:
    word = raw_input('Enter Word')
    
    if word.endswith('ing'):
      print 'Verb'
    elif word.endswith('ed'):
      print 'Whatever you want it to print'
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    43
    Rep Power
    2
    Zergling

    ...Verb?

    Hehe, just kidding, but it makes a good point! Truely writing an algorithm to decide what the type of word is will be tricky, and a matter of priority. For example... Any word with a capital letter that's not at the beginning of a sentence should (usually) be a noun and not a verb

    This is a fun project lol I am almost inspired to play with it.

IMN logo majestic logo threadwatch logo seochat tools logo