Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -108,13 +108,16 @@ class Measurer:
|
|
| 108 |
map_dist = self.map_dist_func[l2][l1]
|
| 109 |
else:
|
| 110 |
map_dist = self.map_dist_func[l2][l1]
|
| 111 |
-
|
| 112 |
-
if
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
| 114 |
else:
|
| 115 |
asp_dist = self.asp_dist_func[l2][l1]
|
| 116 |
-
|
| 117 |
-
asp_dist =
|
| 118 |
if l1 in self.learned_dist_func:
|
| 119 |
if l2 in self.learned_dist_func[l1]:
|
| 120 |
learned_dist = self.learned_dist_func[l1][l2]
|
|
|
|
| 108 |
map_dist = self.map_dist_func[l2][l1]
|
| 109 |
else:
|
| 110 |
map_dist = self.map_dist_func[l2][l1]
|
| 111 |
+
try:
|
| 112 |
+
if l1 in self.asp_dist_func:
|
| 113 |
+
if l2 in self.asp_dist_func[l1]:
|
| 114 |
+
asp_dist = self.asp_dist_func[l1][l2]
|
| 115 |
+
else:
|
| 116 |
+
asp_dist = self.asp_dist_func[l2][l1]
|
| 117 |
else:
|
| 118 |
asp_dist = self.asp_dist_func[l2][l1]
|
| 119 |
+
except KeyError:
|
| 120 |
+
asp_dist = tree_dist # dirty hack, but like 4 codes are not part of phonepiece
|
| 121 |
if l1 in self.learned_dist_func:
|
| 122 |
if l2 in self.learned_dist_func[l1]:
|
| 123 |
learned_dist = self.learned_dist_func[l1][l2]
|