Created
September 8, 2017 22:25
-
-
Save proycon/5d344af1f1df64561941eb4c81565e7c to your computer and use it in GitHub Desktop.
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
from frog import Frog, FrogOptions | |
from pynlpl.formats import folia | |
frog = Frog(FrogOptions(parser=True,xmlout=True)) | |
output = frog.process("Dit is een FoLiA test.") | |
for i, dependency in enumerate(output.select(folia.Dependency)): | |
print("#" + str(i+1)+")") | |
dependent = dependency.dependent() | |
head = dependency.head() | |
print(" DEPENDENT\n ---------") | |
for word in dependent.wrefs(): | |
print(" ",word.id, word.text()) | |
print(" HEAD\n -----") | |
for word in head.wrefs(): | |
print(" ",word.id, word.text()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment