Using NLTK and WordNet, how do I convert simple tense verb into its present, past or past participle form?
For example:
I want to write a function which would give me verb in expected form as follows.
JavaScript
x
7
1
v = 'go'
2
present = present_tense(v)
3
print present # prints "going"
4
5
past = past_tense(v)
6
print past # prints "went"
7
Advertisement
Answer
I think what you’re looking for is the NodeBox::Linguistics library. It does exactly that:
JavaScript
1
3
1
print en.verb.present("gave")
2
>>> give
3