@@ -148,13 +148,13 @@ def _fix_subord_punct(self, node):
148
148
if l_cand is None or l_cand .is_root ():
149
149
l_cand , l_path = None , []
150
150
else :
151
- while (not l_cand .parent .is_root () and l_cand .parent . precedes ( node )
152
- and not node . precedes ( l_cand .descendants (add_self = 1 )[- 1 ]) ):
151
+ while (not l_cand .parent .is_root () and l_cand .parent < node
152
+ and not node < l_cand .descendants (add_self = 1 )[- 1 ]):
153
153
l_cand = l_cand .parent
154
154
l_path .append (l_cand )
155
155
if r_cand is not None :
156
- while (not r_cand .parent .is_root () and node . precedes ( r_cand .parent )
157
- and not r_cand .descendants (add_self = 1 )[0 ]. precedes ( node ) ):
156
+ while (not r_cand .parent .is_root () and node < r_cand .parent
157
+ and not r_cand .descendants (add_self = 1 )[0 ] < node ):
158
158
r_cand = r_cand .parent
159
159
r_path .append (r_cand )
160
160
@@ -226,8 +226,8 @@ def _fix_pair(self, root, opening_node, closing_node):
226
226
if node == opening_node or node == closing_node :
227
227
continue
228
228
# If this is a node inside of the pair, is its parent outside?
229
- if opening_node . precedes ( node ) and node . precedes ( closing_node ) :
230
- if node .parent . precedes ( opening_node ) or closing_node . precedes ( node .parent ) :
229
+ if node > opening_node and node < closing_node :
230
+ if node .parent < opening_node or node .parent > closing_node :
231
231
if node .upos == 'PUNCT' :
232
232
punct_heads .append (node )
233
233
else :
@@ -237,7 +237,7 @@ def _fix_pair(self, root, opening_node, closing_node):
237
237
# happen if an outside node is attached to an inside node. To account for
238
238
# this, mark the inside parent as a head, too.
239
239
else :
240
- if opening_node . precedes ( node .parent ) and node .parent . precedes ( closing_node ) :
240
+ if node .parent > opening_node and node .parent < closing_node :
241
241
if node .parent .upos == 'PUNCT' :
242
242
punct_heads .append (node .parent )
243
243
else :
0 commit comments