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], Symbol], annotatedSentence: AnnotatedSentence) 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

annotatedSentence

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], Symbol], annotatedSentence: AnnotatedSentence)

    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

    annotatedSentence

    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. val annotatedSentence: AnnotatedSentence

    the sentence we want to parse

  5. 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

  6. val arcLabels: Map[Set[Int], Symbol]

    the arc labels of the partially constructed PolytreeParse

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

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

  8. final def asInstanceOf[T0]: T0

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

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

    the breadcrumbs of the partially constructed PolytreeParse

  11. lazy val bufferIsEmpty: Boolean

    Returns whether the buffer has been exhausted.

  12. val bufferPosition: Int

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

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

    the children of the partially constructed PolytreeParse

  14. def clone(): AnyRef

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

    Definition Classes
    AnyRef
  16. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  18. def getGretels(nodeIndex: Int): Set[Int]

  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 sentence: Sentence

  25. val stack: Vector[Int]

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

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

    Definition Classes
    AnyRef
  27. def toString(): String

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. 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