Skip to content

Commit 2c64a6c

Browse files
committed
flatten should also delete all deprels (make them "root")
1 parent 7a91696 commit 2c64a6c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

udapi/block/transform/flatten.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from udapi.core.block import Block
33

44
class Flatten(Block):
5-
"""Apply `node.parent = node.root` on all nodes."""
5+
"""Apply `node.parent = node.root; node.deprel = 'root'` on all nodes."""
66

77
def process_node(self, node):
88
node.parent = node.root
9+
node.deprel = 'root'

udapi/block/tutorial/parse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ def process_tree(self, root):
1919
for node in root.descendants:
2020
if node.next_node:
2121
node.parent = node.next_node
22+
node.deprel = 'root'

0 commit comments

Comments
 (0)