From 27db9d8c05188f64c17d61c394d3dafe8b8e93d8 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sat, 19 Dec 2009 14:32:28 -0500 Subject: cool new alignment feature --- training/cluster-ptrain.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'training') diff --git a/training/cluster-ptrain.pl b/training/cluster-ptrain.pl index 33aab25d..8944ae34 100755 --- a/training/cluster-ptrain.pl +++ b/training/cluster-ptrain.pl @@ -104,7 +104,21 @@ if ($restart) { } else { `cp $initial_weights $dir/weights.1.gz`; } + open T, "<$training_corpus" or die "Can't read $training_corpus: $!"; + open TO, ">$dir/training.in"; + my $lc = 0; + while() { + chomp; + s/^\s+//; + s/\s+$//; + die "Expected A ||| B in input file" unless / \|\|\| /; + print TO "$_\n"; + $lc++; + } + close T; + close TO; } +$training_corpus = "$dir/training.in"; my $iter_attempts = 1; while ($iter < $max_iteration) { -- cgit v1.2.3