MaltParser 1.2

org.maltparser.parser.algorithm.nivre
Class Nivre

java.lang.Object
  extended by org.maltparser.parser.algorithm.nivre.Nivre
All Implemented Interfaces:
ParsingAlgorithm
Direct Known Subclasses:
NivreEager, NivreMalt04, NivreStandard

public abstract class Nivre
extends Object
implements ParsingAlgorithm

Since:
1.0
Author:
Joakim Nivre, Johan Hall

Field Summary
protected  ArrayList<ActionContainer> actionContainers
           
protected  HashSet<ActionContainer> arcLabelActionContainers
           
protected  boolean complexTransition
           
protected  SingleMalt configuration
           
protected  GuideUserAction currentAction
           
protected  GuideUserHistory history
           
protected  Stack<DependencyNode> input
           
static int NORMAL
           
protected  boolean postProcessing
           
protected  ActionContainer pushActionContainer
           
protected  TransitionTable pushTable
           
static int RELAXED
           
protected  int rootHandling
           
protected static int SHIFT
           
protected  Stack<DependencyNode> stack
           
static int STRICT
           
protected  HashMap<String,TableHandler> tableHandlers
           
protected  ActionContainer transActionContainer
           
protected  TransitionTableHandler transitionTableHandler
           
 
Constructor Summary
Nivre(SingleMalt configuration)
           
 
Method Summary
protected abstract  void addAvailableTransitionToTable(TransitionTable ttable)
           
protected  void addEdgeLabels(Edge e)
           
protected  void addTransition(ActionContainer transitionContainer, GuideUserAction action, int value)
           
protected abstract  boolean checkParserAction(DependencyStructure dg)
           
protected  void clear(DependencyStructure dg)
           
protected  LabelSet getArcLabels(DependencyStructure parseDependencyGraph)
           
 SingleMalt getConfiguration()
           
 GuideUserHistory getHistory()
           
 DependencyNode getInputNode(int index)
           
 DependencyNode getLeftTarget()
           
abstract  String getName()
           
 DependencyNode getNode(String dataStructure, int index)
           
 DependencyNode getRightTarget()
           
 int getRootHandling()
           
 DependencyNode getStackNode(int index)
           
protected abstract  int getTransition()
           
protected  void initHistory()
           
protected  void initPostProcessing()
           
protected  void initRootHandling()
           
protected abstract  void initWithDefaultTransitions()
           
protected  boolean isActionContainersLabeled()
           
 DependencyStructure oracleParse(DependencyStructure goldDependencyGraph, DependencyStructure parseDependencyGraph)
           
protected abstract  void oraclePredict(DependencyStructure gold, DependencyStructure parseDependencyGraph)
           
 DependencyStructure parse(DependencyStructure parseDependencyGraph)
           
protected abstract  void transition(DependencyStructure dg)
           
protected abstract  void updateActionContainers(int transition, LabelSet arcLabels)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHIFT

protected static final int SHIFT
See Also:
Constant Field Values

STRICT

public static final int STRICT
See Also:
Constant Field Values

RELAXED

public static final int RELAXED
See Also:
Constant Field Values

NORMAL

public static final int NORMAL
See Also:
Constant Field Values

history

protected GuideUserHistory history

actionContainers

protected ArrayList<ActionContainer> actionContainers

transActionContainer

protected ActionContainer transActionContainer

pushActionContainer

protected ActionContainer pushActionContainer

pushTable

protected TransitionTable pushTable

arcLabelActionContainers

protected HashSet<ActionContainer> arcLabelActionContainers

configuration

protected final SingleMalt configuration

currentAction

protected GuideUserAction currentAction

tableHandlers

protected HashMap<String,TableHandler> tableHandlers

transitionTableHandler

protected TransitionTableHandler transitionTableHandler

rootHandling

protected int rootHandling

postProcessing

protected boolean postProcessing

stack

protected final Stack<DependencyNode> stack

input

protected final Stack<DependencyNode> input

complexTransition

protected boolean complexTransition
Constructor Detail

Nivre

public Nivre(SingleMalt configuration)
      throws MaltChainedException
Throws:
MaltChainedException
Method Detail

parse

public DependencyStructure parse(DependencyStructure parseDependencyGraph)
                          throws MaltChainedException
Specified by:
parse in interface ParsingAlgorithm
Throws:
MaltChainedException

oracleParse

public DependencyStructure oracleParse(DependencyStructure goldDependencyGraph,
                                       DependencyStructure parseDependencyGraph)
                                throws MaltChainedException
Specified by:
oracleParse in interface ParsingAlgorithm
Throws:
MaltChainedException

isActionContainersLabeled

protected boolean isActionContainersLabeled()

addEdgeLabels

protected void addEdgeLabels(Edge e)
                      throws MaltChainedException
Throws:
MaltChainedException

getArcLabels

protected LabelSet getArcLabels(DependencyStructure parseDependencyGraph)
                         throws MaltChainedException
Throws:
MaltChainedException

getStackNode

public DependencyNode getStackNode(int index)
                            throws MaltChainedException
Throws:
MaltChainedException

getInputNode

public DependencyNode getInputNode(int index)
                            throws MaltChainedException
Throws:
MaltChainedException

getLeftTarget

public DependencyNode getLeftTarget()
Specified by:
getLeftTarget in interface ParsingAlgorithm

getRightTarget

public DependencyNode getRightTarget()
Specified by:
getRightTarget in interface ParsingAlgorithm

getNode

public DependencyNode getNode(String dataStructure,
                              int index)
                       throws MaltChainedException
Throws:
MaltChainedException

getRootHandling

public int getRootHandling()

clear

protected void clear(DependencyStructure dg)
              throws MaltChainedException
Throws:
MaltChainedException

initRootHandling

protected void initRootHandling()
                         throws MaltChainedException
Throws:
MaltChainedException

addTransition

protected void addTransition(ActionContainer transitionContainer,
                             GuideUserAction action,
                             int value)
                      throws MaltChainedException
Throws:
MaltChainedException

initPostProcessing

protected void initPostProcessing()
                           throws MaltChainedException
Throws:
MaltChainedException

getConfiguration

public SingleMalt getConfiguration()
Specified by:
getConfiguration in interface ParsingAlgorithm

initHistory

protected void initHistory()
                    throws MaltChainedException
Throws:
MaltChainedException

getHistory

public GuideUserHistory getHistory()
Specified by:
getHistory in interface ParsingAlgorithm

getTransition

protected abstract int getTransition()

updateActionContainers

protected abstract void updateActionContainers(int transition,
                                               LabelSet arcLabels)
                                        throws MaltChainedException
Throws:
MaltChainedException

transition

protected abstract void transition(DependencyStructure dg)
                            throws MaltChainedException
Throws:
MaltChainedException

addAvailableTransitionToTable

protected abstract void addAvailableTransitionToTable(TransitionTable ttable)
                                               throws MaltChainedException
Throws:
MaltChainedException

initWithDefaultTransitions

protected abstract void initWithDefaultTransitions()
                                            throws MaltChainedException
Throws:
MaltChainedException

checkParserAction

protected abstract boolean checkParserAction(DependencyStructure dg)
                                      throws MaltChainedException
Throws:
MaltChainedException

oraclePredict

protected abstract void oraclePredict(DependencyStructure gold,
                                      DependencyStructure parseDependencyGraph)
                               throws MaltChainedException
Throws:
MaltChainedException

getName

public abstract String getName()
Specified by:
getName in interface ParsingAlgorithm

MaltParser 1.2

Copyright 2007-2008 Johan Hall, Jens Nilsson and Joakim Nivre.