summaryrefslogtreecommitdiff
path: root/word-aligner/supplement_weights_file.pl
blob: 76f668e29724868d587dc0d1631a3c8c641f3755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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";
  }
}