Ninja_0203
Ninja_0203

Reputation: 45

How to create a function in nltk to generate aspect of a verb in a sentence?

For example, if the following sentence is given They have been swimming for more than an hour the function should return perfect progressive.

Upvotes: 1

Views: 110

Answers (1)

aerin
aerin

Reputation: 22694

It's a little old library but it will be a good intro for you.

https://www.nodebox.net/code/index.php/Linguistics

print en.verb.present_participle("be")
>>> being

print en.verb.present("gave")
print en.verb.present("gave", person=3, negate=False)
>>> give
>>> gives

print en.verb.tense("was")
>>> 1st singular past

Upvotes: 0

Related Questions