Skip to content

Commit 8e1ad7e

Browse files
committed
Fix colon index check
1 parent 44aba2f commit 8e1ad7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

machine/corpora/aligned_word_pair.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def convert_to_num(token: str) -> int:
2626
alignment_score = -1
2727

2828
second_colon_index = -1
29-
if colon_index > 0:
29+
if colon_index < len(token):
3030
second_colon_index = token.find(":", colon_index + 1)
3131
if second_colon_index > 0:
3232
translation_score = float(token[colon_index + 1 : second_colon_index])

0 commit comments

Comments
 (0)