001 package org.maltparser.parser; 002 003 import org.maltparser.core.exception.MaltChainedException; 004 import org.maltparser.core.syntaxgraph.DependencyStructure; 005 import org.maltparser.parser.guide.OracleGuide; 006 /** 007 * @author Johan Hall 008 * 009 */ 010 public abstract class Trainer extends Algorithm { 011 /** 012 * Creates a parser trainer 013 * 014 * @param manager a reference to the single malt configuration 015 * @throws MaltChainedException 016 */ 017 public Trainer(DependencyParserConfig manager) throws MaltChainedException { 018 super(manager); 019 } 020 021 /** 022 * Trains a parser using the gold-standard dependency graph and returns a parsed dependency graph 023 * 024 * @param goldDependencyGraph a old-standard dependency graph 025 * @param parseDependencyGraph a empty dependency graph 026 * @return a parsed dependency graph 027 * @throws MaltChainedException 028 */ 029 public abstract DependencyStructure parse(DependencyStructure goldDependencyGraph, DependencyStructure parseDependencyGraph) throws MaltChainedException; 030 /** 031 * Returns the oracle guide. 032 * 033 * @return the oracle guide. 034 */ 035 public abstract OracleGuide getOracleGuide(); 036 public abstract void train() throws MaltChainedException; 037 038 }