Alvis-NLPPlatform
view release on metacpan or search on metacpan
bin/ogmios-nlp-standalone view on Meta::CPAN
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use Config::General;
use Pod::Usage;
use Data::Dumper;
use File::Basename;
use Sys::Hostname;
use Alvis::Convert;
use Alvis::NLPPlatform;
use Alvis::NLPPlatform::Convert;
use Encode;
my $man = 0;
my $help = 0;
my $rcfile ;
my $current_dir;
my $dirfile;
my $file;
warn "\nRunning Ogmios (Alvis NLP Platform) version " . $Alvis::NLPPlatform::VERSION . "\n\n";
GetOptions('help|?' => \$help, man => \$man, "rcfile=s" => \$rcfile) or pod2usage(2);
pod2usage(1) if $help;
pod2usage(-exitstatus => 0, -verbose => 2) if $man;
if ((defined $rcfile) && (($rcfile eq "") || (!(-f $rcfile)))) {
warn "No such config file or config file is not set\n";
pod2usage(1);
}
my %config = &Alvis::NLPPlatform::load_config($rcfile);
my $mm = Alvis::NLPPlatform::Convert::load_MagicNumber(\%config);
my $AlvisConverter = Alvis::NLPPlatform::Convert::html2alvis_init(\%config);
my $HOSTNAME=hostname;
my $doc;
if (scalar @ARGV == 0) {
warn "Missing file or directory to analyse\n";
die "Try '" . basename($0) . " --help' for more information.\n";
}
foreach $file (@ARGV) {
if (-f $file) {
print STDERR "Converting the file $file ...\n";
# Insure that Input files will be returned
$config{"CONVERTERS"}->{"StoreInputFiles"} = 0;
$doc = Alvis::NLPPlatform::Convert::conversion_file_to_alvis_xml($file, $AlvisConverter, \%config, $mm);
Alvis::NLPPlatform::standalone(\%config, $HOSTNAME, $doc);
print STDERR "\tdone\n";
( run in 2.401 seconds using v1.01-cache-2.11-cpan-5a3173703d6 )