Skip to content

Commit 7d1fdcf

Browse files
committed
ud.FixPunct don't change root to punct in edeps
1 parent e00e7fe commit 7d1fdcf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

udapi/block/ud/fixpunct.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def __init__(self, check_paired_punct_upos=False, copy_to_enhanced=False, **kwar
5353
based on the form with the exception of single & double quote character,
5454
which is frequently ambiguous*, so UPOS=PUNCT is checked always.
5555
*) Single quote can be an apostrophe. Double quote as a NOUN can be the inch symbol.
56-
copy_to_enhanced: for all PUNCT nodes, let the enhanced depencies be the same
57-
as the basic dependencies.
56+
copy_to_enhanced: for all upos=PUNCT deprel=punct nodes, let the enhanced depencies
57+
be the same as the basic dependencies.
5858
"""
5959
super().__init__(**kwargs)
6060
self._punct_type = None
@@ -118,7 +118,7 @@ def process_tree(self, root):
118118
# TODO: This block changes parents not only for PUNCT nodes. These should be reflected into enhanced deps as well.
119119
if self.copy_to_enhanced:
120120
for node in root.descendants:
121-
if node.upos == 'PUNCT':
121+
if node.upos == 'PUNCT' and node.udeprel == 'punct':
122122
node.deps = [{'parent': node.parent, 'deprel': 'punct'}]
123123

124124
def _fix_subord_punct(self, node):

0 commit comments

Comments
 (0)