#!/usr/bin/perl
my
$man
= 0;
my
$help
= 0;
my
$rcfile
=
"bioyatea.rc"
;
my
$postProcessingFile
=
"sampleBio1-bioyatea-out-pp.xml"
;
my
$ppConfigFile
=
"post-processing-filtering.conf"
;
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
);
if
((
defined
$postProcessingFile
) && (
defined
$ppConfigFile
)) {
my
%options
;
$options
{
'input-file'
} =
$corpus
->getOutputFileSet->getFile(
"candidates"
)->getPath;
warn
"Loading YaTeA output file "
.
$options
{
'input-file'
} .
"\n"
;
$options
{
'output-file'
} =
$postProcessingFile
;
$options
{
'configuration'
} =
$ppConfigFile
;
my
$postProc
= Lingua::BioYaTeA::PostProcessing->new(\
%options
);
my
(
$second
,
$minute
,
$hour
,
$day
,
$month
,
$year
,
$weekday
,
$yearday
,
$isdailysavingtime
) =
localtime
(
time
);
$year
+= 1900;
$postProc
->logfile(dirname(
$postProc
->output_file) .
'/term-filtering-tmp-'
.
"date-$year-$month-${day}_${hour}_$minute"
.
'.log'
);
$postProc
->_printOptions(\
*stderr
);
$postProc
->load_configuration;
$postProc
->defineTwigParser;
$postProc
->filtering;
$postProc
->printResume;
$postProc
->rmlog;
}
}
else
{
die
(
$bioyatea
->getMessageSet->getMessage(
"NO_FILE_ARG"
)->getContent(
$bioyatea
->getOptionSet->getDisplayLanguage) .
"\n"
);
}
}