The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/perl

use strict;
use warnings;
use utf8;

use Getopt::Long;
use Pod::Usage;
use File::Basename;

# use Data::Dumper;
use Lingua::BioYaTeA;
use Lingua::BioYaTeA::Corpus;
use Lingua::BioYaTeA::PostProcessing;

# use Lingua::YaTeA::Corpus;
# use Lingua::YaTeA::Config;
# use Config::General;


# my $verbose;
my $man = 0;
my $help = 0;
my $rcfile = "bioyatea.rc";
my $postProcessingFile;
my $ppConfigFile;

# GetOptions('help|?|h' => \$help, 
# 	   'man|m' => \$man, 
# 	   "rcfile=s" => \$rcfile,
# 	   'post-processing|p=s' => \$postProcessingFile,
# 	   'post-processing-config|C=s' => \$ppConfigFile,
#     ) or pod2usage(2);
# pod2usage(-exitstatus => 0, -verbose => 2) if $man;
# pod2usage(1) if $help or (scalar(@ARGV) == 0);

my $current_dir = `pwd`;
my $corpus_path = "sampleBio1.ttg";

if (defined $rcfile) {
    my %config = Lingua::BioYaTeA->load_config($rcfile);

    my $sys_config ;
    my $bioyatea;
    my $corpus;
    
    $bioyatea = Lingua::BioYaTeA->new($config{"OPTIONS"}, \%config);
    
    if (defined $corpus_path) {
	if (-f $corpus_path) {
	    $corpus = Lingua::BioYaTeA::Corpus->new($corpus_path,$bioyatea->getOptionSet,$bioyatea->getMessageSet);
	} else {
	    die("\"".$corpus_path . "\"". $bioyatea->getMessageSet->getMessage("NO_FILE")->getContent($bioyatea->getOptionSet->getDisplayLanguage) . "\n");
	}
	$bioyatea->termExtraction($corpus);

    } else {
	die( $bioyatea->getMessageSet->getMessage("NO_FILE_ARG")->getContent($bioyatea->getOptionSet->getDisplayLanguage) . "\n");
    }
}