Sha256: ede3599a530c405a4d5cb67717fa2ecb273cfbdf73b76ab7e06778ed9d3bcd1d

Contents?: true

Size: 962 Bytes

Versions: 14

Compression:

Stored size: 962 Bytes

Contents

#!/usr/bin/perl -CSD
#
# Simple command script for executing ParsHed in an
# offline mode (direct API call instead of going through
# the web service).
#
# Luong Minh Thang 25 May, 09. Adopted from Isaac Councill, 08/23/07
#
use strict;
use FindBin;
use lib "$FindBin::Bin/../lib";
use ParsHed::Controller;

my $isTokenLevel = 0; # 1: enable old model which was trained at token level, while the default new model is trained at line level
my @newArgv = ();
foreach(@ARGV){
  if($_ eq "-tokenLevel"){
    $isTokenLevel = 1;
  } else {
    push(@newArgv, $_);
  }
}

my $textFile = $newArgv[0];
my $outFile = $newArgv[1];

if (!defined $textFile) {
    print "Usage: $0 textfile [outfile] [-tokenLevel]\n";
    exit;
}

my $rXML = ParsHed::Controller::extractHeader($textFile, $isTokenLevel);

if (defined $outFile) {
    open (OUT, ">$outFile") or die "Could not open $outFile for writing: $!";
    print OUT $$rXML;
    close OUT;
} else {
    print "$$rXML";
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
biblicit-2.3.2 parscit/bin/headExtract.pl
biblicit-2.3.1 parscit/bin/headExtract.pl
biblicit-2.3.0 parscit/bin/headExtract.pl
biblicit-2.2.3 parscit/bin/headExtract.pl
biblicit-2.2.2 parscit/bin/headExtract.pl
biblicit-2.2.1 parscit/bin/headExtract.pl
biblicit-2.2.0 parscit/bin/headExtract.pl
biblicit-2.1.0 parscit/bin/headExtract.pl
biblicit-2.0.8 parscit/bin/headExtract.pl
biblicit-2.0.7 parscit/bin/headExtract.pl
biblicit-2.0.6 parscit/bin/headExtract.pl
biblicit-2.0.5 parscit/bin/headExtract.pl
biblicit-2.0.4 parscit/bin/headExtract.pl
biblicit-2.0.3 parscit/bin/headExtract.pl