Skip to content

Commit

Permalink
Revert "Secondary prepositions should now use ExtPos=ADP, too."
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-zeman committed Nov 20, 2024
1 parent 89708d3 commit 176c9f5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,16 +1515,18 @@ def validate_upos_vs_deprel(id, tree):
testmessage = "'cop' should be 'AUX' or 'PRON'/'DET' but it is '%s'" % (upos)
warn(testmessage, testclass, testlevel, testid, nodeid=id, lineno=tree['linenos'][id])
# Case is normally an adposition, maybe particle.
# Secondary prepositions ([cs] NOUN pomocí, prostřednictvím; [en] VERB including)
# may keep their original UPOS tag if they use the ExtPos=ADP feature to signal
# that they are acting as preposition.
# However, there are also secondary adpositions and they may have the original POS tag:
# NOUN: [cs] pomocí, prostřednictvím
# VERB: [en] including
# Interjection can also act as case marker for vocative, as in Sanskrit: भोः भगवन् / bhoḥ bhagavan / oh sir.
if deprel == 'case' and re.match(r"^(NOUN|PROPN|ADJ|PRON|DET|NUM|VERB|AUX)", upos):
if deprel == 'case' and re.match(r"^(PROPN|ADJ|PRON|DET|NUM|AUX)", upos):
testid = 'rel-upos-case'
testmessage = "'case' should not be '%s'" % (upos)
warn(testmessage, testclass, testlevel, testid, nodeid=id, lineno=tree['linenos'][id])
# Mark is normally a conjunction or adposition, maybe particle but definitely not a pronoun.
if deprel == 'mark' and re.match(r"^(NOUN|PROPN|ADJ|PRON|DET|NUM|VERB|AUX|INTJ)", upos):
###!!! February 2022: Temporarily allow mark+VERB ("regarding"). In the future, it should be banned again
###!!! by default (and case+VERB too), but there should be a language-specific list of exceptions.
if deprel == 'mark' and re.match(r"^(NOUN|PROPN|ADJ|PRON|DET|NUM|AUX|INTJ)", upos):
testid = 'rel-upos-mark'
testmessage = "'mark' should not be '%s'" % (upos)
warn(testmessage, testclass, testlevel, testid, nodeid=id, lineno=tree['linenos'][id])
Expand Down

0 comments on commit 176c9f5

Please sign in to comment.