views:

19

answers:

1

I'm looking for a way to manipulate a string depending if it's in the past or the future, so I want to:

Test to see if it's now or in the future add an "s" to the string Test to see if it's in the past add a "d" to the string

I know this has come up before, but didn't find it in a search.

Thanks!

Wendy

A: 

I don't know if there's something within django that does this, but you can categorize the tense of a word using NLTK. For examples, see the parts of speech tagger in chapter 5 of the NLTK book (free online).

ars
Thanks, this looks really interesting. I wound up using datetime.date.today() and was able to use => in my template logic to deliver the right word, but I'm going to delve into the book, looks like a great resource.
Wendy