本文介绍了使用NLTK和WordNet;如何将简单的时态动词转换为现在,过去或过去分词形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用NLTK和 WordNet ,如何将简单的时态动词转换为现在,过去或现在过去分词形式?

Using NLTK and WordNet, how do I convert simple tense verb into its present, past or past participle form?

例如:

我想编写一个函数,该函数可以按预期形式为我提供动词,如下所示.

I want to write a function which would give me verb in expected form as follows.

v = 'go'
present = present_tense(v)
print present # prints "going"

past = past_tense(v)
print past # prints "went"

推荐答案

我认为您正在寻找的是 NodeBox ::语言学库.正是这样:

I think what you're looking for is the NodeBox::Linguistics library. It does exactly that:

print en.verb.present("gave")
>>> give

这篇关于使用NLTK和WordNet;如何将简单的时态动词转换为现在,过去或过去分词形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 10:42