}
public void process(Object[] arguments) throws MaltChainedException {
if (mode == LEARN) {
if (arguments.length < 2 || !(arguments[0] instanceof DependencyStructure) || !(arguments[1] instanceof DependencyStructure)) {
throw new MaltChainedException("The single malt learn task must be supplied with at least two dependency structures. ");
}
DependencyStructure systemGraph = (DependencyStructure)arguments[0];
DependencyStructure goldGraph = (DependencyStructure)arguments[1];
if (systemGraph.hasTokens() && getGuide() != null) {
getGuide().finalizeSentence(((Trainer)getAlgorithm()).parse(goldGraph, systemGraph));
}
} else if (mode == PARSE) {
if (arguments.length < 1 || !(arguments[0] instanceof DependencyStructure)) {
throw new MaltChainedException("The single malt parse task must be supplied with at least one input terminal structure and one output dependency structure. ");
}
DependencyStructure processGraph = (DependencyStructure)arguments[0];
if (processGraph.hasTokens()) {
parser.parse(processGraph);
// ((Parser)getAlgorithm()).parse(processGraph);