Parsing Engine

danbikel.parser
Interface Shift

All Known Implementing Classes:
BaseNPAwareShifter, DefaultShifter

public interface Shift

Methods used for the construction of prior states in the Markov process of creating modifier nonterminals. Currently, prior state is stored in a previous modifier list (a SexpList object) and a previous modifier head-word list (a WordList object), so the methods here are used to "shift" a new modifier to the head of these lists, losing the last element of the list (which was the least-recently-generated previous modifier). In the decoder, these previous modifier lists are constructed, so there are two "skip" methods that indicate whether to skip over certain previously-generated modifiers in the construction of these lists.

Implementation note: In the future, the Markov process of generating modifiers will be implemented in a cleaner fashion, by introducing a special State object, which implementors of this interface will manipulate. In other words, this interface will serve to specify a transition function, allowing greater flexibility in the experimentation with different notions of history in the Markov process.


Method Summary
 void shift(TrainerEvent event, SexpList list, Sexp prevMod)
          Shifts the previously-generated modifier label into the history.
 void shift(TrainerEvent event, WordList wordList, Word prevWord)
          Shifts the previously-generated modifier head word into the history.
 boolean skip(Item item, Sexp prevMod)
          Returns whether the previously-generated modifier should be skipped when constructing a history for the specified chart item.
 boolean skip(Item item, Word prevWord)
          Returns whether the previously-generated modifier head word should be skipped when constructing a history for the specified chart item.
 

Method Detail

shift

public void shift(TrainerEvent event,
                  SexpList list,
                  Sexp prevMod)
Shifts the previously-generated modifier label into the history.

Parameters:
event - the TrainerEvent whose history is to be updated
list - the current history of previously-generated modifiers
prevMod - the previously-generated modifier

shift

public void shift(TrainerEvent event,
                  WordList wordList,
                  Word prevWord)
Shifts the previously-generated modifier head word into the history.

Parameters:
event - the TrainerEvent whose history is to be updated
wordList - the current history of previously-generated modifier head words
prevWord - the head word of the previously-generated modifier

skip

public boolean skip(Item item,
                    Sexp prevMod)
Returns whether the previously-generated modifier should be skipped when constructing a history for the specified chart item.

Parameters:
item - the CKYItem object whose history is being constructed
prevMod - the previously-generated modifier
Returns:
whether or not to skip the specified previous modifier when constructing the modifier history for the specified chart item

skip

public boolean skip(Item item,
                    Word prevWord)
Returns whether the previously-generated modifier head word should be skipped when constructing a history for the specified chart item.

Parameters:
item - the CKYItem object whose history is being constructed
prevWord - the head word of the previously-generated modifier
Returns:
whether or not to skip the specified previous modifier's head word when constructing the modifier head word history for the specified chart item

Parsing Engine

Author: Dan Bikel.