From 14a0691a23247771cd739b1513422f110c7be3ac Mon Sep 17 00:00:00 2001
From: Victor Zimmermann <zimmermann@cl.uni-heidelberg.de>
Date: Tue, 6 Mar 2018 16:26:04 +0100
Subject: [PATCH] bug fix

---
 code/absinth_nx.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/code/absinth_nx.py b/code/absinth_nx.py
index 57cae2f..8b76553 100644
--- a/code/absinth_nx.py
+++ b/code/absinth_nx.py
@@ -199,16 +199,16 @@ def disambiguate(mst, hubs, contexts):
         
         idx = contexts.index(c) + 1
         
-        if max(vector) == 0:
-            result.append((backup_cluster, idx))
-            backup_cluster += 1
-        else:
-            try:
-                cluster = np.argmax(vector)
-                result.append((cluster, idx))
-            except:
+        try:
+            if max(vector) == 0:
                 result.append((backup_cluster, idx))
                 backup_cluster += 1
+            else:    
+                cluster = np.argmax(vector)
+                result.append((cluster, idx))
+        except:
+            result.append((backup_cluster, idx))
+            backup_cluster += 1
         
     return result
 
-- 
GitLab