From da222df300e4f87ad185a7decbf119ad56aa34e0 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Fri, 29 Jan 2010 15:56:59 +0000 Subject: word aligner checkin --- word-aligner/supplement_weights_file.pl | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 word-aligner/supplement_weights_file.pl (limited to 'word-aligner/supplement_weights_file.pl') 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 <) { + 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"; + } +} + -- cgit v1.2.3