{
switch (mode)
{
case NLPMode.MODE_POS : return new POSTrainer();
case NLPMode.MODE_DEP : return new DEPTrainer();
case NLPMode.MODE_PRED: return new PredTrainer();
case NLPMode.MODE_ROLE: return new RoleTrainer();
case NLPMode.MODE_SRL : return new SRLTrainer();
}
throw new IllegalArgumentException("The requested mode '"+mode+"' is not supported.");