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 | 45d094ed4520b87372ad6a4afb06e23d752129d7 (patch) | |
tree | a2ba54d81382c7f1579e871fe75ff12fac34b66a /word-aligner | |
parent | 52fcde1cdffbefee730bb90e535c54c9d426f6d3 (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() |