summaryrefslogtreecommitdiff
path: root/realtime/mkinput.py
diff options
context:
space:
mode:
authorMichael Denkowski <mdenkows@cs.cmu.edu>2013-09-15 20:32:59 -0700
committerMichael Denkowski <mdenkows@cs.cmu.edu>2013-09-15 20:32:59 -0700
commit895dfd64ea5599ab16981cbfb538ec5f4073c8c1 (patch)
tree969ded641a86f3cc9ba07685b5bfccd7a50d9a8c /realtime/mkinput.py
parent58763340c02ddafa056d0a00a061cecfb33c9c0c (diff)
Move to using named commands
Diffstat (limited to 'realtime/mkinput.py')
-rwxr-xr-xrealtime/mkinput.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/realtime/mkinput.py b/realtime/mkinput.py
new file mode 100755
index 00000000..897b44fd
--- /dev/null
+++ b/realtime/mkinput.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+
+import itertools
+import sys
+
+def main():
+
+ if len(sys.argv[1:]) != 2:
+ sys.stderr.write('usage: {} test.src test.ref >test.input\n'.format(sys.argv[0]))
+ sys.exit(2)
+
+ for (src, ref) in itertools.izip(open(sys.argv[1]), open(sys.argv[2])):
+ sys.stdout.write('{}'.format(src))
+ sys.stdout.write('LEARN ||| {} ||| {}'.format(src.strip(), ref))
+
+if __name__ == '__main__':
+ main()