Parsing Engine

danbikel.parser
Class DefaultShifter

java.lang.Object
  extended bydanbikel.parser.DefaultShifter
All Implemented Interfaces:
Shift

public class DefaultShifter
extends Object
implements Shift

A default implementation of the Shift interface that simply shifts every modifier or word, skipping nothing. That is, the shift(TrainerEvent,SexpList,Sexp) method shifts the specified previous modifier into the specified previous modifier list, the shift(TrainerEvent,WordList,Word) method shifts the specified word into the specified previous word list and the two skip methods both return false regardless of the values of their arguments.


Constructor Summary
DefaultShifter()
          Default constructor.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultShifter

public DefaultShifter()
Default constructor.

Method Detail

shift

public void shift(TrainerEvent event,
                  SexpList list,
                  Sexp prevMod)
Description copied from interface: Shift
Shifts the previously-generated modifier label into the history.

Specified by:
shift in interface Shift
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)
Description copied from interface: Shift
Shifts the previously-generated modifier head word into the history.

Specified by:
shift in interface Shift
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)
Description copied from interface: Shift
Returns whether the previously-generated modifier should be skipped when constructing a history for the specified chart item.

Specified by:
skip in interface Shift
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)
Description copied from interface: Shift
Returns whether the previously-generated modifier head word should be skipped when constructing a history for the specified chart item.

Specified by:
skip in interface Shift
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.