Skip to content

Commit 9c2edda

Browse files
committed
Remove unnecessary name repetition in equality comparisions
1 parent 8be0ef4 commit 9c2edda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/graphs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, tokens, mode="sparse", feat_map=None, weight_vector=None):
4747
# on feat_map. The completed graphs also get a score per arc (based on the features and the weight vector).
4848

4949
# normal graph
50-
if mode == "sparse" or mode == "full":
50+
if mode in ["sparse", "full"]:
5151
for token1 in tokens:
5252
# add arc from root to it's dependent
5353
if token1.head == 0:
@@ -80,7 +80,7 @@ def __init__(self, tokens, mode="sparse", feat_map=None, weight_vector=None):
8080
self.heads[token1.id] = dependents
8181

8282
# completed graph
83-
elif mode == "complete-sparse" or "complete-full":
83+
elif mode in ["complete-sparse", "complete-full"]:
8484
for token1 in tokens:
8585

8686
# add arcs from root to every node

0 commit comments

Comments
 (0)