#!/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 Lingua::Ogmios;

# use Encode;

my $man = 0;
my $help = 0;
my $rcfile="etc/ogmios/nlpplatform.rc" ;

my $current_dir;
my $dirfile;
my $file;

my $lang;
my $paramsA=['all'];
my $params;
my $param;
my $format;

warn "\nRunning Ogmios (NLP Platform) version " . $Lingua::Ogmios::VERSION . "\n\n";

GetOptions('help|?' => \$help, 
           'man' => \$man, 
	   "rcfile=s" => \$rcfile,
	   "lang=s" => \$lang,
	   "params=s@" => \$paramsA,
	   "format=s" => \$format,
	   ) 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);
} 

warn "Creating Ogmios\n";
my $NLPPlatform = Lingua::Ogmios->new('rcfile' => $rcfile);

if (defined $paramsA) {
    foreach $param (@$paramsA) {
	$params->{$param}++;
    }
}

if ((defined $format) && ($format eq "dot")) {
    $NLPPlatform->printConfigDOT($lang, $params);
} else {
    $NLPPlatform->printConfig($lang, $params);
}
exit 0;


__END__



# =head1 NAME

# ogmios-printConfig - Perl script for linguistically annotating files
# given in argument and in various format (PDF, Word, etc.).

# =head1 SYNOPSIS

# ogmios-standalone [options] [<] [Input_document | Directory] > Annotated_Output_Document

# =head1 OPTIONS

# =over 4

# =item    B<--help>            brief help message

# =item    B<--man>             full documentation

# =item    B<--rcfile=file>     read the given configuration file

# =back

# =head1 DESCRIPTION

# This script linguistically annotates the document given in the
# standard input. Documents can be in various formats. They are firstly
# converted in the ALVIS XML format.  The annotated document is sent to
# the standard output.

# The linguistic annotation depends on the configuration variables and
# dependencies between annotation levels.

# =head1 SEE ALSO

# Alvis web site: http://www.alvis.info

# =head1 AUTHORS

# Thierry Hamon <thierry.hamon@limsi.fr>

# =head1 LICENSE

# Copyright (C) 2005 by Thierry Hamon

# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself, either Perl version 5.8.6 or,
# at your option, any later version of Perl 5 you may have available.

# =cut
