From 3be7e14daa7491db21661702ca53d0438c6d16b3 Mon Sep 17 00:00:00 2001 From: redpony Date: Wed, 23 Jun 2010 18:50:36 +0000 Subject: pipeline stub git-svn-id: https://ws10smt.googlecode.com/svn/trunk@14 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/pipeline/local-gi-pipeline.pl | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 gi/pipeline/local-gi-pipeline.pl (limited to 'gi/pipeline') diff --git a/gi/pipeline/local-gi-pipeline.pl b/gi/pipeline/local-gi-pipeline.pl new file mode 100755 index 00000000..8a0e10c2 --- /dev/null +++ b/gi/pipeline/local-gi-pipeline.pl @@ -0,0 +1,47 @@ +#!/usr/bin/perl -w +use strict; +my $SCRIPT_DIR; BEGIN { use Cwd qw/ abs_path cwd /; use File::Basename; $SCRIPT_DIR = dirname(abs_path($0)); push @INC, $SCRIPT_DIR; } + +use IPC::Run3; +use File::Temp qw ( tempdir ); +my $TEMP_DIR = tempdir( CLEANUP => 1 ); + +my $EXTOOLS = "$SCRIPT_DIR/../../extools"; +die "Can't find extools: $EXTOOLS" unless -e $EXTOOLS && -d $EXTOOLS; +my $PYPTOOLS = "$SCRIPT_DIR/../pyp-topics/src"; +die "Can't find extools: $PYPTOOLS" unless -e $PYPTOOLS && -d $PYPTOOLS; +my $REDUCER = "$EXTOOLS/mr_stripe_rule_reduce"; + +my $PYP_TOPICS_TRAIN="$PYPTOOLS/pyp-topics-train"; + +my $EXTRACTOR = "$EXTOOLS/extractor"; +my $FILTER = "$EXTOOLS/filter_grammar"; +my $SCORER = "$EXTOOLS/score_grammar"; + +assert_exec($REDUCER, $EXTRACTOR, $FILTER, $SCORER, $PYP_TOPICS_TRAIN); + +usage() unless scalar @ARGV == 1; +open F, "<$ARGV[0]" or die "Can't read $ARGV[0]: $!"; +close F; +exit 0; + +sub usage { + print <