#!/bin/bash

export THIERRYHOME=/lhome/thierry

export PERL5LIB=$THIERRYHOME/local/lib/perl:$THIERRYHOME/local/share/perl:$PERL5LIB

export NLPTOOLS=$THIERRYHOME/Platform/NLPtools

export TERMTAGGER=$NLPTOOLS/Alvis-TermTagger
export OGMIOS=$THIERRYHOME/Programs/Lingua-Ogmios
export YATEA=$NLPTOOLS/Lingua-YaTeA

export PERL5LIB=$OGMIOS/lib:$PERL5LIB
export PATH=$OGMIOS/bin:$PATH

PERL5LIB=$TERMTAGGER/lib:$PERL5LIB
PATH=$TERMTAGGER/bin:$PATH

PERL5LIB=$YATEA/lib:$PERL5LIB
PATH=$YATEA/bin:$PATH

COLLECTIONDIR=$1
THRESHOLD=$2
# JOBNAME=$3
# SAMPLESIZE=$4
PREVIOUSTOPIC=$3
TOPICOUTPUT=$4
SEEDOUTPUT=$5
MERGING=$6

echo "$OGMIOS/bin/ogmios-nlp-standalone --rcfile=$OGMIOS/etc/ogmios/nlpplatform.rc $COLLECTIONDIR | \
     /lhome/thierry/Programs/Lingua-Ogmios/bin/splitSeedsAndTopic.pl  --threshold=$THRESHOLD --previoustopicDefinition=$PREVIOUSTOPIC --seedfilename=$SEEDOUTPUT --merge=$MERGING > $TOPICOUTPUT"

$OGMIOS/bin/ogmios-nlp-standalone --rcfile=$OGMIOS/etc/ogmios/nlpplatform.rc $COLLECTIONDIR | \
     /lhome/thierry/Programs/Lingua-Ogmios/bin/splitSeedsAndTopic.pl  --threshold=$THRESHOLD --previoustopicDefinition=$PREVIOUSTOPIC --seedfilename=$SEEDOUTPUT --merge=$MERGING > $TOPICOUTPUT

# cat topicsdefs.list| /lhome/thierry/Programs/Lingua-Ogmios/bin/splitSeedsAndTopic.pl --threshold=100 --topicDefinition=topicsdefs.list --previoustopicDefinition=/lhome/thierry/Data/Ei72/StartTermlist.txt --seedfilename=/lhome/thierry/Data/Ei72/Seeds-1.txt --merge=partial
#  | head -$THRESHOLD | \
#                                           $OGMIOS/bin/splitSeedsAndTopic.pl $TOPICOUTPUT $SEEDOUTPUT


# /lhome/thierry/Programs/Lingua-Ogmios/bin/ogmios-nlp-standalone.sh /lhome/thierry/Data/Ei72/1/DocumentCollections 100 /lhome/thierry/Data/Ei72/StartTermlist.txt /lhome/thierry/topicsdefs.list /lhome/thierry/Data/Ei72/Seeds-1.txt none


#/lhome/thierry/Programs/Lingua-Ogmios/bin/ogmios-nlp-standalone.sh $workdir $threshold 
