diff options
author | mjdenkowski <michael.j.denkowski@gmail.com> | 2013-12-04 14:43:50 -0500 |
---|---|---|
committer | mjdenkowski <michael.j.denkowski@gmail.com> | 2013-12-04 14:43:50 -0500 |
commit | 6fb6d64e8191912ed80a652175ccf4e7ce9c0b00 (patch) | |
tree | 57fee2735bcc7674f33227e64aef65a1f24e089f /word-aligner | |
parent | 901e9d8e96a03d8998cf3732b90296156e233751 (diff) |
Flush each line
Diffstat (limited to 'word-aligner')
-rwxr-xr-x | word-aligner/force_align.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/word-aligner/force_align.py b/word-aligner/force_align.py index d5d59d11..8386e6a5 100755 --- a/word-aligner/force_align.py +++ b/word-aligner/force_align.py @@ -21,9 +21,13 @@ def main(): sys.exit(2) aligner = ForceAligner(*sys.argv[1:]) - - for line in sys.stdin: + + while True: + line = sys.stdin.readline() + if not line: + break sys.stdout.write('{}\n'.format(aligner.align_formatted(line.strip()))) + sys.stdout.flush() aligner.close() |