Skip to content

Instantly share code, notes, and snippets.

@nournia
Last active December 11, 2015 07:19
Show Gist options
  • Save nournia/4565693 to your computer and use it in GitHub Desktop.
Save nournia/4565693 to your computer and use it in GitHub Desktop.
Dadegan valency matching
import codecs
from search.models import Valency, Dependency
for verb in codecs.open('static/verbs.txt', encoding='utf8'):
verb = verb.strip()
count = len(Dependency().findVerbSentences(verb))
for valency in Valency().find(verb):
print '%-15s\t%s %s' % ('%d/%d' % (len(valency['sentences']), count), valency['verb']['surface'].encode('utf8'), Valency().str(valency['verb']['valency']).encode('utf8'))
@nournia
Copy link
Author

nournia commented Jan 18, 2013

Just put it in dadegan root directory and make matching list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment