diff options
author | Chris Dyer <redpony@gmail.com> | 2010-01-29 15:56:59 +0000 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2010-01-29 15:56:59 +0000 |
commit | da222df300e4f87ad185a7decbf119ad56aa34e0 (patch) | |
tree | 1137deefefd28b1a89f6b2b339883801cc12cb29 /word-aligner/supplement_weights_file.pl | |
parent | ee4383b3bc67e2d8ce113fce716050dc2e1b8572 (diff) |
word aligner checkin
Diffstat (limited to 'word-aligner/supplement_weights_file.pl')
-rwxr-xr-x | word-aligner/supplement_weights_file.pl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/word-aligner/supplement_weights_file.pl b/word-aligner/supplement_weights_file.pl new file mode 100755 index 00000000..76f668e2 --- /dev/null +++ b/word-aligner/supplement_weights_file.pl @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w +use strict; + +my ($f_classes) = @ARGV; + +die "Usage: $0 f-classes.file" unless $f_classes && -f $f_classes; + +print <<EOT; +MarkovJump 0 +RelativeSentencePosition 0 +EOT + +# ! 8 +# " 11 +# 's 18 + +my %dcats = (); +$dcats{'BOS'} = 1; +$dcats{'EOS'} = 1; + +open FC, "<$f_classes" or die; +while(<FC>) { + chomp; + my ($x, $cat) = split /\s+/; + $dcats{$cat} = 1; +} + +my @cats = sort keys %dcats; + +for (my $i=0; $i < scalar @cats; $i++) { + my $c1 = $cats[$i]; + for (my $j=0; $j < scalar @cats; $j++) { + my $c2 = $cats[$j]; + print "SP:${c1}_${c2} 0\n"; + } +} + |