001package org.maltparser.parser; 002 003import org.maltparser.core.exception.MaltChainedException; 004import org.maltparser.core.syntaxgraph.DependencyStructure; 005import org.maltparser.parser.history.HistoryNode; 006/** 007 * @author Johan Hall 008 * 009 */ 010public abstract class ParserConfiguration { 011 protected HistoryNode historyNode; 012 013 014 /** 015 * Creates a parser configuration 016 */ 017 public ParserConfiguration() { 018 setHistoryNode(null); 019 } 020 021 public HistoryNode getHistoryNode() { 022 return historyNode; 023 } 024 025 public void setHistoryNode(HistoryNode historyNode) { 026 this.historyNode = historyNode; 027 } 028 029 /** 030 * Sets the dependency structure 031 * 032 * @param dependencyStructure a dependency structure 033 * @throws MaltChainedException 034 */ 035 public abstract void setDependencyGraph(DependencyStructure dependencyStructure) throws MaltChainedException; 036 /** 037 * Returns true if the parser configuration is in a terminal state, otherwise false. 038 * 039 * @return true if the parser configuration is in a terminal state, otherwise false. 040 * @throws MaltChainedException 041 */ 042 public abstract boolean isTerminalState() throws MaltChainedException; 043 /** 044 * Returns the dependency structure 045 * 046 * @return the dependency structure 047 */ 048 public abstract DependencyStructure getDependencyGraph(); 049 /** 050 * Clears the parser configuration 051 * 052 * @throws MaltChainedException 053 */ 054 public abstract void clear() throws MaltChainedException; 055 056// /** 057// * Initialize the parser configuration with the same state as the parameter config 058// * 059// * @param config a parser configuration 060// * @throws MaltChainedException 061// */ 062// public abstract void initialize(ParserConfiguration config) throws MaltChainedException; 063 /** 064 * Initialize the parser configuration 065 * 066 * @throws MaltChainedException 067 */ 068 public abstract void initialize() throws MaltChainedException; 069}