Skip to content

Commit 80e7be8

Browse files
committed
Keep relators outside the scene in CMR expansion normalization
1 parent ecf0c0d commit 80e7be8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ucca/normalization.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
NO_MULTIPLE_INCOMING_CATEGORIES = {ETags.Function, ETags.ParallelScene, ETags.Linker, ETags.LinkRelation,
66
ETags.Connector, ETags.Punctuation, ETags.Terminal}
77
TOP_CATEGORIES = {ETags.ParallelScene, ETags.Linker, ETags.Function, ETags.Ground, ETags.Punctuation,
8-
ETags.LinkRelation, ETags.LinkArgument, ETags.Connector}
8+
ETags.Relator, ETags.LinkRelation, ETags.LinkArgument, ETags.Connector}
9+
KEEP_OUTSIDE_CMR = {ETags.Relator}
910
COORDINATED_MAIN_REL = "Coordinated_Main_Rel."
1011

1112

@@ -288,7 +289,9 @@ def split_coordinated_main_rel(node, l1):
288289
if scene_edge.ID != edge.ID and not (
289290
scenes and NO_MULTIPLE_INCOMING_CATEGORIES.intersection(scene_edge.tags)):
290291
# Not the CMR edge itself, and not a category that does not allow multiple parents
291-
copy_edge(scene_edge, parent=new_scene, attrib={"remote": True} if scenes else None)
292+
copy_edge(scene_edge,
293+
parent=top if KEEP_OUTSIDE_CMR.intersection(scene_edge.tags) else new_scene,
294+
attrib={"remote": True} if scenes else None)
292295
scenes.append(new_scene)
293296
for main_rel_edge in main_rel_non_centers:
294297
tags = main_rel_edge.tags

0 commit comments

Comments
 (0)