org.allenai.nlpstack.parse.poly.polyparser

TransitionParserState

Related Doc: package polyparser

case class TransitionParserState(stack: Vector[Int], bufferPosition: Int, breadcrumb: Map[Int, Int], children: Map[Int, Set[Int]], arcLabels: Map[Set[Int], ArcLabel], sentence: Sentence, previousLink: Option[(Int, Int)] = None, parserMode: Int = 0) extends State with Product with Serializable

A TransitionParserState captures the current state of a transition-based parser (i.e. it corresponds to a partially constructed PolytreeParse). It includes the following fields: - the stack holds the indices of the tokens (note: the index of a token is its index in the tokens vector) on the stack. It is a vector of integers. The head of the vector represents the top of the stack. - the bufferPosition is an integer representing the index of the token that is currently at the front of the buffer. - breadcrumb maps the index of a token to its breadcrumb (see org.allenai.nlpstack.parse.poly.polyparser.PolytreeParse for the definition of breadcrumb). If a token index does not appear as a key in breadcrumb, then its breadcrumb has not yet been determined. - children maps the index of a token to the indices of its children (in the partially constructed polytree). - arcLabels maps a pair of token indices to the label of the arc between them. This presupposes that the two tokens are neighbors in the partially constructed polytree. Note that the pair of token indices is represented as a Set, so order is irrelevant. - tokens is the sequence of tokens in the sentence we are trying to parse. This will be invariant for all states of a given parsing process.

stack

the indices of the token indices on the 'stack' (stack.head is the stack top)

bufferPosition

the index of the token at the front of the 'buffer'

breadcrumb

the breadcrumbs of the partially constructed PolytreeParse

children

the children of the partially constructed PolytreeParse

arcLabels

the arc labels of the partially constructed PolytreeParse

sentence

the sentence we want to parse

Linear Supertypes
Serializable, Serializable, Product, Equals, State, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TransitionParserState
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. State
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TransitionParserState(stack: Vector[Int], bufferPosition: Int, breadcrumb: Map[Int, Int], children: Map[Int, Set[Int]], arcLabels: Map[Set[Int], ArcLabel], sentence: Sentence, previousLink: Option[(Int, Int)] = None, parserMode: Int = 0)

    stack

    the indices of the token indices on the 'stack' (stack.head is the stack top)

    bufferPosition

    the index of the token at the front of the 'buffer'

    breadcrumb

    the breadcrumbs of the partially constructed PolytreeParse

    children

    the children of the partially constructed PolytreeParse

    arcLabels

    the arc labels of the partially constructed PolytreeParse

    sentence

    the sentence we want to parse

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def applyTransitionSequence(transitions: Seq[(TransitionParserState) ⇒ TransitionParserState]): TransitionParserState

    Applies the provided sequence of Transitions (in order) to the state.

    Applies the provided sequence of Transitions (in order) to the state.

    transitions

    a list of Transitions to be applied (in order)

    returns

    the new state resulting from the sequence of transitions applied to this state

  5. val arcLabels: Map[Set[Int], ArcLabel]

    the arc labels of the partially constructed PolytreeParse

  6. def areNeighbors(token1: Int, token2: Int): Boolean

    Returns whether the two tokens are connected in the parse created thus far.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def asSculpture: Option[Sculpture]

    Definition Classes
    TransitionParserStateState
  9. val breadcrumb: Map[Int, Int]

    the breadcrumbs of the partially constructed PolytreeParse

  10. lazy val bufferIsEmpty: Boolean

    Returns whether the buffer has been exhausted.

  11. val bufferPosition: Int

    the index of the token at the front of the 'buffer'

  12. val children: Map[Int, Set[Int]]

    the children of the partially constructed PolytreeParse

  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def getGretels(token: Int): Set[Int]

    Gets the set of gretels of the specified token in the partial parse tree represented by this state.

    Gets the set of gretels of the specified token in the partial parse tree represented by this state.

    token

    the token (index) of interest

    returns

    the set of that token's gretels

  18. def getParents(token: Int): Set[Int]

    Gets the set of parents of the specified token in the partial parse tree represented by this state.

    Gets the set of parents of the specified token in the partial parse tree represented by this state.

    token

    the token (index) of interest

    returns

    the set of that token's parents

  19. lazy val isFinal: Boolean

    Returns whether this is the final state of a transition parse.

    Returns whether this is the final state of a transition parse.

    Definition Classes
    TransitionParserStateState
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. val parserMode: Int

  25. val previousLink: Option[(Int, Int)]

  26. val sentence: Sentence

    the sentence we want to parse

  27. val stack: Vector[Int]

    the indices of the token indices on the 'stack' (stack.head is the stack top)

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    TransitionParserState → AnyRef → Any
  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from State

Inherited from AnyRef

Inherited from Any

Ungrouped