diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2014-08-03 19:16:03 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2014-08-03 19:16:03 -0400 |
| commit | 102a573a7e6fd711da874c76f74b47df37ff124e (patch) | |
| tree | 033c472e0f785d8071f6e67cb7ac3e6e3b0e3e36 | |
| parent | 070c4f8f2a74cb677808c203890a584c1dd6c88f (diff) | |
| download | ocr-layer-curation-102a573a7e6fd711da874c76f74b47df37ff124e.tar.gz | |
fix invert_align
| -rw-r--r-- | string_utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/string_utils.py b/string_utils.py index fb3fe50..0588418 100644 --- a/string_utils.py +++ b/string_utils.py @@ -157,11 +157,11 @@ def print_alignment(l1, l2, c2, alignment): print u"{0:>25} | {1}".format("", word) def invert_align(alignment, n): - l = [[]] *n + l = [[] for _ in range(n)] for i, e in enumerate(alignment): for a in e: l[a].append(i) - + return l def alignment_to_coord(l1, alignment): # l1 list of corrected words |
