Skip to content

Commit

Permalink
flat
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-zeman committed Nov 4, 2024
1 parent 724b900 commit 3d49ce3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,10 @@ def validate_functional_leaves(id, tree):
# Joakim thinks that such possessives should be nmod rather than det,
# but that's not how many of us understand the UD guidelines. For now,
# the test should be thus relaxed if the determiner has Poss=Yes.
if re.match(r"^(det)$", pdeprel) and not re.match(r"^(det|case|advmod|obl|clf|goeswith|fixed|compound|reparandum|discourse|parataxis|conj|cc|punct)$", cdeprel) and not ('Poss=Yes' in pfeats and re.match(r"^(appos|acl|nmod)$", cdeprel)):
# Flavio also argued that certain multiword det expressions should be
# connected by flat:redup (rather than fixed), which is why flat should
# be another exception.
if re.match(r"^(det)$", pdeprel) and not re.match(r"^(det|case|advmod|obl|clf|goeswith|fixed|flat|compound|reparandum|discourse|parataxis|conj|cc|punct)$", cdeprel) and not ('Poss=Yes' in pfeats and re.match(r"^(appos|acl|nmod)$", cdeprel)):
testid = 'leaf-det'
testmessage = "'%s' not expected to have children (%s:%s:%s --> %s:%s:%s)" % (pdeprel, idparent, tree['nodes'][idparent][FORM], pdeprel, idchild, tree['nodes'][idchild][FORM], cdeprel)
warn(testmessage, 'Warning', testlevel, testid, nodeid=id, lineno=tree['linenos'][idchild])
Expand Down

0 comments on commit 3d49ce3

Please sign in to comment.