    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.history.HistoryNode;
    006    /**
    007     * @author Johan Hall
    008     *
    009     */
    010    public 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             * Initialize the parser configuration with the same state as the parameter config
    057             *
    058             * @param config a parser configuration
    059             * @throws MaltChainedException
    060             */
    061            public abstract void initialize(ParserConfiguration config) throws MaltChainedException;
    062    }