Parsing Engine

danbikel.parser
Class Shifter

java.lang.Object
  extended by danbikel.parser.Shifter

public class Shifter
extends Object

A class containing only static methods that mirror the signatures of the Shift interface, allowing a convenient flow-through mechanism to an internal static Shift object, the exact type of which is determined by the value of Settings.shifterClass.


Method Summary
static void shift(TrainerEvent event, SexpList list, Sexp prevMod)
          Uses the internal Shifter instance to shift the newly-generated (and therefore previously-generated) modifier into the history, which is a SexpList.
static void shift(TrainerEvent event, WordList wordList, Word prevWord)
          Uses the internal Shifter instance to shift the newly-generated (and therefore previously-generated) head word into the history, which is a WordList.
static boolean skip(CKYItem item, Sexp prevMod)
          Uses the internal Shifter instance to determine whether the specified modifier should be skipped when constructing a history for the specified chart item.
static boolean skip(CKYItem item, Word prevWord)
          Uses the internal Shifter instance to determine whether the specified 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
 

Method Detail

shift

public static void shift(TrainerEvent event,
                         SexpList list,
                         Sexp prevMod)
Uses the internal Shifter instance to shift the newly-generated (and therefore previously-generated) modifier into the history, which is a SexpList.

Parameters:
event - the event whose history is being updated
list - the history list from the event to be updated
prevMod - the previously-generated modifier

shift

public static void shift(TrainerEvent event,
                         WordList wordList,
                         Word prevWord)
Uses the internal Shifter instance to shift the newly-generated (and therefore previously-generated) head word into the history, which is a WordList.

Parameters:
event - the event whose history is being updated
wordList - the history list from the event to be updated
prevWord - the previously-generated modifier

skip

public static boolean skip(CKYItem item,
                           Sexp prevMod)
Uses the internal Shifter instance to determine whether the specified modifier should be skipped when constructing a history for the specified chart item.

Parameters:
item - the chart item whose history is being constructed
prevMod - the previously-generated modifier to be tested
Returns:
whether the specified modifier should be skipped when constructing the previous-modifier history

skip

public static boolean skip(CKYItem item,
                           Word prevWord)
Uses the internal Shifter instance to determine whether the specified modifier head word should be skipped when constructing a history for the specified chart item.

Parameters:
item - the chart item whose history is being constructed
prevWord - the previously-generated modifier head word to be tested
Returns:
whether the specified modifier head word should be skipped when constructing the previous-modifier head word history

Parsing Engine

Author: Dan Bikel.