Parsing Engine

danbikel.parser
Class Collins

java.lang.Object
  extended by danbikel.parser.Collins
All Implemented Interfaces:
NonterminalMapper

public class Collins
extends Object
implements NonterminalMapper

Provides a nonterminal mapping scheme that, when applied to previously-generated modifiers, allows for emulation of Michael Collins' modifier-generation model.

N.B.: The mapPrevMod(Symbol) static method has been deprecated. Classes should use the more flexible mechanism provided by the NTMapper class.

See Also:
map(Symbol), NTMapper, Settings.prevModMapperClass

Field Summary
static Symbol conjSym
          The conjunction equivalence class.
static Symbol miscSym
          The miscellaneous equivalence class.
static Symbol puncSym
          The punctuation equivalence class.
static Symbol startSym
          The start symbol equivalence class.
 
Constructor Summary
Collins()
           
 
Method Summary
 Symbol map(Symbol nonterminal)
          Maps the specified nonterminal to one of four equivalence classes.
static Symbol mapPrevMod(Symbol prevMod)
          Deprecated. Classes should now use NTMapper.map(Symbol), since the NTMapper class provides the flexibility of using an internal NonterminalMapper instance created at run-time according to the Settings.prevModMapperClass setting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startSym

public static final Symbol startSym
The start symbol equivalence class.


conjSym

public static final Symbol conjSym
The conjunction equivalence class.


puncSym

public static final Symbol puncSym
The punctuation equivalence class.


miscSym

public static final Symbol miscSym
The miscellaneous equivalence class.

Constructor Detail

Collins

public Collins()
Method Detail

mapPrevMod

public static Symbol mapPrevMod(Symbol prevMod)
Deprecated. Classes should now use NTMapper.map(Symbol), since the NTMapper class provides the flexibility of using an internal NonterminalMapper instance created at run-time according to the Settings.prevModMapperClass setting.

Maps the specified previous modifier to one of four equivalence classes.

Parameters:
prevMod - the previous modifier to be mapped
Returns:
a mapped version of the specified previous modifier
See Also:
NTMapper, NonterminalMapper, Settings.prevModMapperClass

map

public Symbol map(Symbol nonterminal)
Maps the specified nonterminal to one of four equivalence classes. The mapping is determined by the following sequence of cases:
map(nonterminal) = startSym if nonterminal == Language.training().startSym()
conjSym if Language.treebank().isConjunction(nonterminal)
puncSym if Language.treebank().isPunctuation(nonterminal)
miscSym otherwise

Specified by:
map in interface NonterminalMapper
Parameters:
nonterminal - the nonterminal to be mapped
Returns:
the specified nonterminal mapped to one of four possible equivalence classes
See Also:
Training.startSym(), Treebank.isConjunction(Symbol), Treebank.isPunctuation(Symbol)

Parsing Engine

Author: Dan Bikel.