Given a POS tag, such as VBD, how can I conjugate a verb to match with NLTK?
e.g.
VERB: go
POS: VBD
RESULT: went
NLTK doesn't currently provide conjugations. Pattern-en and nodebox do conjugations.
Sometimes the examples in the pattern-en website don't work as shown. This worked for me:
>>> from pattern.en import conjugate
>>> verb = "go"
>>> conjugate(verb,
... tense = "past", # INFINITIVE, PRESENT, PAST, FUTURE
... person = 3, # 1, 2, 3 or None
... number = "singular", # SG, PL
... mood = "indicative", # INDICATIVE, IMPERATIVE, CONDITIONAL, SUBJUNCTIVE
... aspect = "imperfective", # IMPERFECTIVE, PERFECTIVE, PROGRESSIVE
... negated = False) # True or False
u'went'
>>>
NOTE
It seems like conjugate
only outputs when the tense doesn't require an auxiliary verb. For instance, in Spanish the (singular first person) future of ir is iré. In English, the future of go is formed with the auxiliary will and the infinitive go, resulting in will go. In the code below, iré is output, but not will go.
>>> from pattern.es import conjugate as conjugate_es
>>> verb = "ir"
>>> conjugate_es(verb, tense = "future")
u'ir\xe1'
>>> from pattern.en import conjugate as conjugate_en
>>> verb = "go"
>>> conjugate_en(verb, tense = "future")
>>>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With