summaryrefslogtreecommitdiff
path: root/word-aligner/merge_corpus.pl
diff options
context:
space:
mode:
Diffstat (limited to 'word-aligner/merge_corpus.pl')
-rwxr-xr-xword-aligner/merge_corpus.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/word-aligner/merge_corpus.pl b/word-aligner/merge_corpus.pl
new file mode 100755
index 00000000..02827903
--- /dev/null
+++ b/word-aligner/merge_corpus.pl
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+use strict;
+die "Usage: $0 corpus.e|f corpus.f|e" unless scalar @ARGV == 2;
+
+my ($a, $b) = @ARGV;
+open A, "<$a" or die "Can't read $a: $!";
+open B, "<$b" or die "Can't read $a: $!";
+
+while(<A>) {
+ chomp;
+ my $e = <B>;
+ die "Mismatched lines in $a and $b!" unless defined $e;
+ print "$_ ||| $e";
+}
+
+my $e = <B>;
+die "Mismatched lines in $a and $b!" unless !defined $e;
+