Skip to content

Instantly share code, notes, and snippets.

@nournia
Created October 16, 2014 12:39
Show Gist options
  • Save nournia/c8d6e6141b3be75b69ec to your computer and use it in GitHub Desktop.
Save nournia/c8d6e6141b3be75b69ec to your computer and use it in GitHub Desktop.
Verb Conjugations
from hazm import VerbValencyReader, Lemmatizer
valency = VerbValencyReader('/home/alireza/Corpora/valency.txt')
lemmatizer = Lemmatizer()
output = open('verbs.txt', 'w')
verbs = set([verb.past_light_verb +'#'+ verb.present_light_verb for verb in valency.verbs()])
print('است', file=output)
for verb in verbs:
print(*lemmatizer.conjugations(verb), sep='\n', file=output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment