aboutsummaryrefslogtreecommitdiffstats
path: root/string_utils.py
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@serenitascapital.com>2013-08-21 16:33:14 -0400
committerGuillaume Horel <guillaume.horel@serenitascapital.com>2013-08-21 16:33:14 -0400
commitd295c767717874045aab27d30759fd3ec7ed49fa (patch)
tree692d68c11d6c75175101201c90bd3a34fd1c1dd9 /string_utils.py
parentf7168bf05ec4b976dd74b357bff7ff54d0693f13 (diff)
downloadocr-layer-curation-d295c767717874045aab27d30759fd3ec7ed49fa.tar.gz
small simplifaction
Diffstat (limited to 'string_utils.py')
-rw-r--r--string_utils.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/string_utils.py b/string_utils.py
index 61320ac..186f2eb 100644
--- a/string_utils.py
+++ b/string_utils.py
@@ -96,7 +96,7 @@ def align(l1, l2, c2):
a[0][j] = j, []
for i in xrange(1, n + 1):
- a[i][0] = i * del_cost1, [] * i
+ a[i][0] = i * del_cost1, [[]] * i
for j in xrange(1, m + 1):
@@ -142,10 +142,8 @@ def print_alignment(l1, l2, c2, alignment):
print u"{0:>25} | ".format(word)
else:
begin, end = index[0], index[-1]
-
- while prev < begin - 1:
- prev += 1
- print u"{0:>25} | {1}".format("", l2[prev])
+ for i in range(prev, begin-1):
+ print u"{0:>25} | {1}".format("", l2[i+1])
prev = end
if end > begin: