Last active
December 11, 2015 07:19
-
-
Save nournia/4565693 to your computer and use it in GitHub Desktop.
Dadegan valency matching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just put it in dadegan root directory and make matching list.