@echo off
if "%1"=="" goto error
if not exist "JLearnIt.jar" goto error
if "%2"=="" goto process1
if "%3"=="" goto process2

java -cp JLearnIt.jar jlearnit.data.FileSplitter %2 %2.temp1 %1
java -cp JLearnItPDA.jar;SuperWaba\superwaba.jar jlearnit.JLearnItTxt2PDB %2.temp1 %3
del %2.temp1
goto end

:process1
java -cp JLearnIt.jar jlearnit.data.FileSplitter vocabulary.txt vocabulary.temp1 %1
java -cp JLearnItPDA.jar;SuperWaba\superwaba.jar jlearnit.JLearnItTxt2PDB vocabulary.temp1
del vocabulary.temp1
goto end

:process2
java -cp JLearnIt.jar jlearnit.data.FileSplitter vocabulary.txt vocabulary.temp1 %1
java -cp JLearnItPDA.jar;SuperWaba\superwaba.jar jlearnit.JLearnItTxt2PDB vocabulary.temp1 %2
del vocabulary.temp1
goto end

:error
echo Syntax: convert2PDB <sections> [<input file>] [<output file>]
echo e.g. convert2PDB 1_3_5
echo e.g. convert2PDB 0_1_2_3_4_5_6_7_8_9_10_11_12_13_14
echo e.g. convert2PDB 1_0 EN-FR.pdb
echo e.g. convert2PDB 1_0 vocabulary.txt VOCAB
echo e.g. convert2PDB 0_1_2_3_4_5_6_7_8_9_10_11 vocabulary_shorten.txt VOCAB
echo Please also copy JLearnIt.jar to this directory
pause
goto end

:end

