|
Parsing Engine | |||||||||
PREV NEXT | FRAMES NO FRAMES |
Packages that use Sexp | |
---|---|
danbikel.lisp | Provides classes to create, read and manipulate symbolic expressions (S-expressions), including interned symbols. |
danbikel.parser | Provides the core framework of this extensible statistical parsing engine. |
danbikel.parser.arabic | Provides language-specific classes necessary to parse Arabic. |
danbikel.parser.chinese | Provides language-specific classes necessary to parse Chinese. |
danbikel.parser.constraints | Provides interfaces and classes to allow constrain-parsing. |
danbikel.parser.english | Provides language-specific classes necessary to parse English. |
danbikel.parser.lang | Provides default abstract base classes for the required interfaces of a language package. |
danbikel.parser.util | Utility classes for displaying and manipulating parse trees. |
Uses of Sexp in danbikel.lisp |
---|
Subclasses of Sexp in danbikel.lisp | |
---|---|
class |
IntSymbol
IntSymbol objects associate integers with unique references. |
class |
SexpList
Stores a list of Sexp objects, which are either symbols
or themselves lists. |
static class |
SexpList.HashCache
A subclass of SexpList where a precomputed, cached
hash value is stored with every instance. |
class |
StringSymbol
StringSymbol objects associate strings with unique references. |
class |
Symbol
Symbol objects associate strings or integers with
unique references. |
Methods in danbikel.lisp that return Sexp | |
---|---|
abstract Sexp |
Sexp.deepCopy()
Returns a deep copy of this S-expression. |
Sexp |
SexpList.deepCopy()
Returns a deep copy of this list, which means that a full copy of the tree of S-expressions held by this list is returned. |
Sexp |
Symbol.deepCopy()
|
Sexp |
SexpList.first()
Returns the first element of this list (identical to calling get(0) ). |
Sexp |
SexpList.get(int index)
Gets the Sexp at the specified index. |
Sexp |
Sexp.getCanonical(Map map)
Returns a canonical version of this S-expression. |
Sexp |
SexpList.last()
Returns the last element of this list (identical to calling get(size() - 1) ). |
static Sexp |
Sexp.read(SexpTokenizer tok)
Returns the S-expression contained in the stream held by tok . |
static Sexp |
Sexp.read(SexpTokenizer tok,
char open,
char close)
|
static Sexp |
Sexp.read(String in)
Returns the S-expression contained in the specified string. |
Sexp |
SexpList.remove(int index)
Removes the element at index . |
Sexp |
SexpList.set(int index,
Sexp element)
Replaces the element at index with element . |
Sexp |
SexpConvertible.toSexp()
Converts this object to an S-expression. |
Methods in danbikel.lisp with parameters of type Sexp | |
---|---|
SexpList |
SexpList.add(int index,
Sexp sexp)
Adds sexp at position index , shifting all
elements to the right by one position to make room (an O(n) operation). |
SexpList |
SexpList.add(Sexp sexp)
Appends sexp to the end of this list. |
boolean |
SexpList.contains(Sexp toFind)
Returns whether the specified S-expression is an element of this list. |
int |
SexpList.indexOf(Sexp toFind)
Finds the index of the specified S-expresion. |
Sexp |
SexpList.set(int index,
Sexp element)
Replaces the element at index with element . |
Uses of Sexp in danbikel.parser |
---|
Subclasses of Sexp in danbikel.parser | |
---|---|
class |
SubcatList
Implements subcats where requirements need to be met in the order in which they are added to this subcat (the strictest form of a subcat). |
Fields in danbikel.parser declared as Sexp | |
---|---|
protected Sexp |
SexpEvent.event
The event stored by this instance. |
Methods in danbikel.parser that return Sexp | |
---|---|
Sexp |
Training.addBaseNPs(Sexp tree)
Adds and/or relabels base NPs in the specified tree. |
Sexp |
Training.addGapInformation(Sexp tree)
Augments nonterminals to include gap information for WHNP's that have moved and leave traces (gaps), as in the GPSG framework. |
Sexp |
HeadFinder.addHeadInformation(Sexp tree)
Perform head-finding in tree , augmenting nodes that are the
head child of their parent by appending HeadFinder.headSuffix() . |
Sexp |
Treebank.constructPreterminal(Word word)
Converts a Word object into a preterminal subtree. |
Sexp |
CachingDecoderServer.convertUnknownWord(Symbol originalWord,
int index)
Returns either the specified word untouched, or a 3-element list as would be created by CachingDecoderServer.convertUnknownWords(SexpList) . |
Sexp |
DecoderServer.convertUnknownWord(Symbol originalWord,
int index)
|
Sexp |
DecoderServerRemote.convertUnknownWord(Symbol originalWord,
int index)
Returns either the specified word untouched, or a 3-element list as would be created by DecoderServerRemote.convertUnknownWords(SexpList) . |
protected Sexp |
Parser.convertUnknownWords(Sexp tree,
IntCounter currWordIdx)
Converts certain words (leaves) in the specified tree to their associated word-feature vectors. |
protected Sexp |
SexpEvent.copySexpEvent()
Returns a deep copy of the underlying Sexp of this event. |
Sexp |
SubcatList.get(int index)
|
Sexp |
Training.identifyArguments(Sexp tree)
Augments labels of nonterminals that are arguments. |
protected Sexp |
Decoder.parse(SexpList sentence)
Parses the specified sentence. |
Sexp |
Parser.parse(SexpList sent)
Parses the specified sentence, which can be in one of three formats. |
protected Sexp |
Decoder.parse(SexpList sentence,
SexpList tags)
Parses the specified sentence using the supplied list of part-of-speech tags. |
protected Sexp |
Decoder.parse(SexpList sentence,
SexpList tags,
ConstraintSet constraints)
Parses the specified sentence using the supplied list of part-of-speech tags and the supplied set of parsing constraints. |
Sexp |
Training.preProcess(Sexp tree)
The method to call before counting events in a training parse tree. |
Sexp |
Training.prune(Sexp tree)
Prunes away subtrees that have a root that is an element of nodesToPrune . |
Sexp |
Training.raisePunctuation(Sexp tree)
Raises punctuation to the highest possible point in a parse tree, resulting in a tree where no punctuation is the first or last child of a non-leaf node. |
Sexp |
Training.relabelSubjectlessSentences(Sexp tree)
Relabels sentences that have no subjects with the nonterminal label returned by Treebank.subjectlessSentenceLabel() . |
Sexp |
Treebank.removeAugmentation(Sexp sexp,
Nonterminal nonterminal,
Symbol augmentation)
Removes the specified nonterminal augmentation from the specified S-expression, using the specified Nonterminal object for temporary
storage. |
Sexp |
Training.removeGapAugmentation(Sexp sexp)
If the specified S-expression is a list, this method modifies the list to contain only symbols without gap augmentations; otherwise, this method removes the gap augmentation (if one exists) in the specified symbol and returns that new symbol. |
Sexp |
Training.removeNullElements(Sexp tree)
Removes all null elements, that is, those nodes of tree for
which Treebank.isNullElementPreterminal(Sexp) returns
true . |
Sexp |
Training.repairBaseNPs(Sexp tree)
Changes the specified tree so that when the last child of an NPB is an S, the S gets raised to be a sibling immediately following the NPB. |
Sexp |
Training.stripAugmentations(Sexp tree)
Strips any augmentations off all of the nonterminal labels of tree . |
Sexp |
BrokenSubcatBag.toSexp()
As per the contract of Subcat , this method returns a
Sexp such that an equivalent BrokenSubcatBag
object would result from the BrokenSubcatBag.addAll(SexpList) method being
invoked with this Sexp as its argument. |
Sexp |
CKYItem.toSexp()
Returns the S-expression representation of the tree rooted at this chart item. |
Sexp |
HeadTreeNode.toSexp()
|
Sexp |
SexpEvent.toSexp()
Returns the Sexp contained in this event. |
Sexp |
SexpSubcatEvent.toSexp()
If this event has no subcat, then this method simply returns the backing Sexp ; otherwise, this method returns a SexpList
of the form (sexp subcat) , where sexp
is the Sexp component(s) of this event and subcat
is the result of calling subcat.toSexp() . |
Sexp |
Subcat.toSexp()
Returns a list view of the information contained in this subcat, such that an equivalent subcat would result if a new Subcat object of this run-time type were constructed
and its Subcat.addAll(SexpList) method were invoked with the
list returned by this method. |
Sexp |
SubcatBag.toSexp()
As per the contract of Subcat , this method returns a
Sexp such that an equivalent SubcatBag object
would result from the SubcatBag.addAll(SexpList) method being invoked with
this Sexp as its argument. |
Sexp |
SubcatList.toSexp()
|
Sexp |
Word.toSexp()
|
Sexp |
HeadTreeNode.toSexp(boolean addHeadWords)
|
protected Sexp |
CKYItem.toSexpInternal(boolean isHeadChild)
Returns the S-expression representation of the tree rooted at this chart item (helper method invoked by CKYItem.toSexp() ). |
Methods in danbikel.parser with parameters of type Sexp | |
---|---|
Sexp |
Training.addBaseNPs(Sexp tree)
Adds and/or relabels base NPs in the specified tree. |
Sexp |
Training.addGapInformation(Sexp tree)
Augments nonterminals to include gap information for WHNP's that have moved and leave traces (gaps), as in the GPSG framework. |
Sexp |
HeadFinder.addHeadInformation(Sexp tree)
Perform head-finding in tree , augmenting nodes that are the
head child of their parent by appending HeadFinder.headSuffix() . |
protected void |
Word.checkSexp(Sexp s)
Checks that the S-expression passed to Word.Word(Sexp) is the right
format. |
protected void |
Trainer.collectStats(Sexp orig,
HeadTreeNode tree,
boolean isRoot)
Collects the statistics from the specified tree. |
protected Sexp |
Parser.convertUnknownWords(Sexp tree,
IntCounter currWordIdx)
Converts certain words (leaves) in the specified tree to their associated word-feature vectors. |
int |
HeadFinder.findHead(Sexp tree)
Finds the head for the production at the root of the specified subtree. |
int |
HeadFinder.findHead(Sexp tree,
Symbol lhs,
SexpList rhs)
Finds the head for the grammar production lhs → rhs . |
Word |
DefaultWordFactory.get(Sexp s)
|
Word |
WordFactory.get(Sexp s)
Constructs a Word object from the specified S-expression, which
must be a list of length 2 or greater, where the first two elements are
symbols. |
static Word |
Words.get(Sexp s)
Returns a new Word instance constructed from the specified
S-expression. |
protected ConstraintSet |
Parser.getConstraintsFromTree(Sexp tree)
After converting unknown words in the specified parse tree, this method constructs a constraint set using the method ConstraintSets.get(Object) . |
Symbol |
Treebank.getTag(Sexp preterminal)
Gets the component of the preterminal tree that corresponds to the part of speech tag. |
protected SexpList |
Parser.getTagListsFromTree(Sexp tree)
Collects a list of symbols that are the part-of-speech tags (preterminals) of the specified tree. |
int |
Treebank.getTraceIndex(Sexp preterm,
Nonterminal nonterminal)
Returns the index of a trace for the specified null element preterminal. |
protected SexpList |
Parser.getWordsFromTree(Sexp tree)
Returns a new list containing the word symbols from the specified tree. |
protected SexpList |
Parser.getWordsFromTree(SexpList wordList,
Sexp tree)
Gets the words of the sentence to be parsed from the specified parse tree. |
Sexp |
Training.identifyArguments(Sexp tree)
Augments labels of nonterminals that are arguments. |
boolean |
Treebank.isAugDelim(Sexp sexp)
Returns whether the specified S-expression is a symbol that is an augmentation delimiter for a complex nonterminal label. |
boolean |
Treebank.isNullElementPreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal whose terminal element is the null element for the current
language's Treebank. |
boolean |
Treebank.isPossessivePreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal that is the possessive part of speech. |
boolean |
Treebank.isPreterminal(Sexp tree)
Returns whether tree represents a preterminal subtree in the
parse trees for this language's Treebank. |
protected boolean |
Decoder.isPuncRaiseWord(Sexp word)
Returns whether the specified word was raised as part of the punctuation-raising procedure performed during training. |
boolean |
Treebank.isPuncToRaise(Sexp preterm)
Returns true if the specified S-expression represents
a preterminal and a part-of-speech tag that indicates punctuation
to be raised when running Training.raisePunctuation(Sexp) . |
boolean |
Training.isValidTree(Sexp tree)
Returns whether the specified tree is valid. |
boolean |
Treebank.isVerb(Sexp preterminal)
Returns true if the specified preterminal is that of a verb. |
Word |
Treebank.makeWord(Sexp preterminal)
Constructs a Word object from the specified preterminal
subtree. |
protected void |
Decoder.postProcess(Sexp tree)
Performs post-processing on a sentence that has been parsed. |
void |
Training.postProcess(Sexp tree)
Post-processes a parse tree after decoding, eseentially undoing the steps performed in preprocessing. |
protected SexpList |
EMParser.preProcess(Sexp tree)
Instead of simply invoking the Training.preProcess(Sexp) method,
this method selectively invokes only some of the preprocessing methods of
Training , so as to leave the rest of the transformations
unconstrained. |
Sexp |
Training.preProcess(Sexp tree)
The method to call before counting events in a training parse tree. |
Sexp |
Training.prune(Sexp tree)
Prunes away subtrees that have a root that is an element of nodesToPrune . |
Sexp |
Training.raisePunctuation(Sexp tree)
Raises punctuation to the highest possible point in a parse tree, resulting in a tree where no punctuation is the first or last child of a non-leaf node. |
Sexp |
Training.relabelSubjectlessSentences(Sexp tree)
Relabels sentences that have no subjects with the nonterminal label returned by Treebank.subjectlessSentenceLabel() . |
Sexp |
Treebank.removeAugmentation(Sexp sexp,
Nonterminal nonterminal,
Symbol augmentation)
Removes the specified nonterminal augmentation from the specified S-expression, using the specified Nonterminal object for temporary
storage. |
Sexp |
Training.removeGapAugmentation(Sexp sexp)
If the specified S-expression is a list, this method modifies the list to contain only symbols without gap augmentations; otherwise, this method removes the gap augmentation (if one exists) in the specified symbol and returns that new symbol. |
Sexp |
Training.removeNullElements(Sexp tree)
Removes all null elements, that is, those nodes of tree for
which Treebank.isNullElementPreterminal(Sexp) returns
true . |
Sexp |
Training.repairBaseNPs(Sexp tree)
Changes the specified tree so that when the last child of an NPB is an S, the S gets raised to be a sibling immediately following the NPB. |
protected int |
Decoder.restoreOriginalWords(Sexp tree,
int wordIdx)
Restores the original words in the current sentence. |
protected void |
Decoder.restorePrunedWords(Sexp tree)
Restores pruned words to a parsed sentence. |
protected int |
Decoder.restorePrunedWordsRecursive(Sexp tree,
int wordIdx)
The recursive helper method for Decoder.restorePrunedWords(Sexp) . |
void |
SexpEvent.setSexp(Sexp event)
Sets the backing Sexp of this object to be the specified Sexp. |
void |
BaseNPAwareShifter.shift(TrainerEvent event,
SexpList list,
Sexp prevMod)
The previous modifier is not shifted into the history if the current parent (as determined by TrainerEvent.parent() ) is a base
NP and the previous modifier is punctuation. |
void |
DefaultShifter.shift(TrainerEvent event,
SexpList list,
Sexp prevMod)
|
void |
Shift.shift(TrainerEvent event,
SexpList list,
Sexp prevMod)
Shifts the previously-generated modifier label into the history. |
static void |
Shifter.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 boolean |
Shifter.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. |
boolean |
BaseNPAwareShifter.skip(Item item,
Sexp prevMod)
The previous modifier is skipped (not included in the construction of the history) if the current parent (as determined by CKYItem.label() )
is a base NP and the previous modifier is punctuation. |
boolean |
DefaultShifter.skip(Item item,
Sexp prevMod)
|
boolean |
Shift.skip(Item item,
Sexp prevMod)
Returns whether the previously-generated modifier should be skipped when constructing a history for the specified chart item. |
String |
Training.skip(Sexp tree)
Returns whether the specified tree is to be skipped when training. |
Sexp |
Training.stripAugmentations(Sexp tree)
Strips any augmentations off all of the nonterminal labels of tree . |
protected boolean |
Parser.wordTagList(Sexp sexp)
Returns whether the specified S-expression is a list of length two whose first element is a symbol and whose second element is a list of one or more symbols. |
Constructors in danbikel.parser with parameters of type Sexp | |
---|---|
GapEvent(Sexp sexp)
Contructs a new object from the specified S-expression. |
|
HeadEvent(Sexp sexp)
Contructs a new object from the specified S-expression. |
|
HeadTreeNode(Sexp tree)
Constructs a new instance from the specified parse tree. |
|
ModifierEvent(Sexp sexp)
Constructs a new object from the specified S-expression. |
|
SexpEvent(Sexp event)
Creates a new SexpEvent using the specified S-expression. |
|
SymbolPair(Sexp sexp)
Constructs a SymbolPair from the first two symbols in the specified
list. |
|
Word(Sexp s)
Constructs a word using the symbols contained in the specified S-expression, which must be a list of at least two symbols. |
Uses of Sexp in danbikel.parser.arabic |
---|
Methods in danbikel.parser.arabic that return Sexp | |
---|---|
Sexp |
Training.preProcess(Sexp tree)
The method to call before counting events in a training parse tree. |
protected Sexp |
Training.transformTags(Sexp tree)
Does an in-place transformation of the part-of-speech tags in the specified tree. |
Methods in danbikel.parser.arabic with parameters of type Sexp | |
---|---|
protected void |
Training.canonicalizeNonterminals(Sexp tree)
For arabic, we do not want to transform preterminals (parts of speech) to their canonical forms, so this method is overridden. |
int |
HeadFinder.findHead(Sexp tree,
Symbol lhs,
SexpList rhs)
Finds the head for the grammar production lhs -> rhs . |
protected boolean |
Training.hasPossessiveChild(Sexp tree)
We override this method so that it always returns false ,
so that the default implementation of addBaseNPs(Sexp) |
boolean |
Treebank.isNullElementPreterminal(Sexp tree)
Returns true if the specified S-expression represents a
preterminal whose terminal element is the null element
("-NONE-" ) for the Penn Arabic Treebank. |
boolean |
Treebank.isPossessivePreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal that is the possessive part of speech. |
boolean |
Treebank.isPreterminal(Sexp tree)
Returns true if tree represents a preterminal
subtree (part-of-speech tag and word). |
boolean |
Treebank.isPuncToRaise(Sexp preterm)
Returns true if the specified S-expression is a preterminal
whose part of speech is "," or
":" . |
boolean |
Training.isValidTree(Sexp tree)
If the specified tree has a root label with a print name equal to "X", then this method returns false ;
otherwise, this method returns the value of the default implementation in
the superclass with the specified tree
(super.isValidTree(tree) ). |
boolean |
Treebank.isVerb(Sexp preterminal)
Returns true if preterminal represents a
terminal with one of the following parts of speech: VB, VBD, VBG,
VBN, VBP or VBZ. |
Sexp |
Training.preProcess(Sexp tree)
The method to call before counting events in a training parse tree. |
protected Sexp |
Training.transformTags(Sexp tree)
Does an in-place transformation of the part-of-speech tags in the specified tree. |
Constructors in danbikel.parser.arabic with parameters of type Sexp | |
---|---|
HeadFinder(Sexp headTableSexp)
Constructs an Arabic head-finding object with the specified head table. |
Uses of Sexp in danbikel.parser.chinese |
---|
Methods in danbikel.parser.chinese that return Sexp | |
---|---|
Sexp |
NoNPBTraining.addBaseNPs(Sexp tree)
We override this method from the default implementation so that it does nothing. |
protected Sexp |
Training.combineRightSiblingsOfDe5(Sexp tree)
A method to create a new node if a DEG or DEC preterminal has more than one right sibling. |
Sexp |
NPArgThreadTraining.preProcess(Sexp tree)
Performs all the preprocessing setps of the overridden AbstractTraining.preProcess(Sexp) method of the superclass, and then provides an
additional preprocessing step by invoking AbstractTraining.threadNPArgAugmentations(Sexp) . |
Sexp |
Training.relabelSubjectlessSentences(Sexp tree)
We override AbstractTraining.relabelSubjectlessSentences(Sexp) so
that we can make the definition of a subjectless sentence
slightly more restrictive: a subjectless sentence not only must
have a null-element child that is marked with the subject
augmentation, but also its head must be a VP (this is
Mike Collins’ definition of a subjectless sentence). |
protected Sexp |
Training.unrepairBaseNPs(Sexp tree)
A method to un-do the transformation provided by AbstractTraining.repairBaseNPs(Sexp) (for inclusion
in an overridden definition of
AbstractTraining.postProcess(Sexp) ,
but currently unused by this class). |
Methods in danbikel.parser.chinese with parameters of type Sexp | |
---|---|
Sexp |
NoNPBTraining.addBaseNPs(Sexp tree)
We override this method from the default implementation so that it does nothing. |
protected Sexp |
Training.combineRightSiblingsOfDe5(Sexp tree)
A method to create a new node if a DEG or DEC preterminal has more than one right sibling. |
int |
HeadFinder.findHead(Sexp tree,
Symbol lhs,
SexpList rhs)
Finds the head for the grammar production lhs -> rhs . |
boolean |
Treebank.isNullElementPreterminal(Sexp tree)
Returns true if the specified S-expression represents a
preterminal whose terminal element is the null element
("-NONE-" ) for the Chinese Treebank. |
boolean |
Treebank.isPossessivePreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal that is the possessive part of speech. |
boolean |
Treebank.isPreterminal(Sexp tree)
Returns true if tree represents a preterminal
subtree (part-of-speech tag and word). |
boolean |
Treebank.isPuncToRaise(Sexp preterm)
Returns true if the specified S-expression is a preterminal
whose part of speech is "," or
". |
boolean |
Treebank.isVerb(Sexp preterminal)
Returns true if preterminal represents a
terminal with one of the following parts of speech: VB, VBD, VBG,
VBN, VBP or VBZ. |
Sexp |
NPArgThreadTraining.preProcess(Sexp tree)
Performs all the preprocessing setps of the overridden AbstractTraining.preProcess(Sexp) method of the superclass, and then provides an
additional preprocessing step by invoking AbstractTraining.threadNPArgAugmentations(Sexp) . |
Sexp |
Training.relabelSubjectlessSentences(Sexp tree)
We override AbstractTraining.relabelSubjectlessSentences(Sexp) so
that we can make the definition of a subjectless sentence
slightly more restrictive: a subjectless sentence not only must
have a null-element child that is marked with the subject
augmentation, but also its head must be a VP (this is
Mike Collins’ definition of a subjectless sentence). |
protected Sexp |
Training.unrepairBaseNPs(Sexp tree)
A method to un-do the transformation provided by AbstractTraining.repairBaseNPs(Sexp) (for inclusion
in an overridden definition of
AbstractTraining.postProcess(Sexp) ,
but currently unused by this class). |
Constructors in danbikel.parser.chinese with parameters of type Sexp | |
---|---|
HeadFinder(Sexp headTableSexp)
Constructs an Chinese head-finding object with the specified head table. |
Uses of Sexp in danbikel.parser.constraints |
---|
Methods in danbikel.parser.constraints that return Sexp | |
---|---|
Sexp |
LexTreeConstraint.toSexp()
|
Sexp |
PartialLexTreeConstraint.toSexp()
|
Sexp |
PartialTreeConstraint.toSexp()
Returns a symbolic expression representing the tree of constraints rooted at this constraint (intended for debugging purposes). |
Sexp |
UnlexTreeConstraint.toSexp()
Returns a symbolic expression version of the constraint tree rooted at this constraint. |
Methods in danbikel.parser.constraints with parameters of type Sexp | |
---|---|
protected void |
LexTreeConstraintSet.buildConstraintSet(Sexp tree)
Builds the constraint tree from a lexicalized version of the specified unlexicalized parse tree (exicalization performed by the current head finder). |
protected void |
PartialLexTreeConstraintSet.buildConstraintSet(Sexp tree)
Builds the constraint tree from the specified unlexicalized parse tree. |
protected void |
PartialTreeConstraintSet.buildConstraintSet(Sexp tree)
Builds the constraint tree from the specified unlexicalized parse tree. |
protected void |
UnlexTreeConstraintSet.buildConstraintSet(Sexp tree)
Builds the constraint tree from the specified unlexicalized parse tree. |
Constructors in danbikel.parser.constraints with parameters of type Sexp | |
---|---|
LexTreeConstraint(LexTreeConstraint parent,
Sexp tree,
IntCounter currWordIdx,
HeadFinder headFinder)
Constructs a tree of constraints that is isomorphic to the specified parse tree. |
|
LexTreeConstraint(Sexp tree)
Constructs a tree of constraints that is isomorphic to the specified parse tree. |
|
LexTreeConstraintSet(Sexp tree)
Constructs a new set of constraints according to a lexicalized version of the specified unlexicalized tree. |
|
PartialLexTreeConstraint(PartialLexTreeConstraint parent,
Sexp tree,
IntCounter currWordIdx,
HeadFinder headFinder)
A helper constructor used by PartialLexTreeConstraint.PartialLexTreeConstraint(Sexp)
to construct an entire tree of constraints. |
|
PartialLexTreeConstraint(Sexp tree)
Constructs a tree of constraints given the specified parse tree. |
|
PartialLexTreeConstraintSet(Sexp tree)
Constructs a set of PartialLexTreeConstraint objects forming a tree
structure from the specified syntactic tree. |
|
PartialTreeConstraint(PartialTreeConstraint parent,
Sexp tree,
IntCounter currWordIdx)
A helper constructor for constructing a tree of constraints rooted at the specified subtree with the specified parent . |
|
PartialTreeConstraint(Sexp tree)
Constructs a tree of constraints rooted at the specified syntactic tree. |
|
PartialTreeConstraintSet(Sexp tree)
Returns a set of partial tree constraints whose tree structure is isomorphic to the specified (possibly partial) syntactic tree. |
|
UnlexTreeConstraint(Sexp tree)
Constructs the root constraint of a tree of constraints isomorphic to the specified unlexicalized tree. |
|
UnlexTreeConstraint(UnlexTreeConstraint parent,
Sexp tree,
IntCounter currWordIdx)
Constructs a tree of constraints isomorphic to the specified unlexicalized syntactic tree. |
|
UnlexTreeConstraintSet(Sexp tree)
Constructs a constraint set derived from the specified unlexicalized syntactic tree. |
Uses of Sexp in danbikel.parser.english |
---|
Methods in danbikel.parser.english that return Sexp | |
---|---|
Sexp |
BrokenTraining.fixSubjectlessSentences(Sexp tree)
This method has been written to do nothing to the specified tree. |
Sexp |
Training.fixSubjectlessSentences(Sexp tree)
De-transforms sentence labels changed by Training.relabelSubjectlessSentences(Sexp) when the subjectless sentence
node has children prior to its head child that are arguments. |
Sexp |
BrokenTraining.identifyArguments(Sexp tree)
Marks certain nodes as arguments by appending a suffix to their respective labels. |
Sexp |
BrokenTraining.preProcess(Sexp tree)
|
Sexp |
NPArgThreadTraining.preProcess(Sexp tree)
Identical to Training.preProcess(danbikel.lisp.Sexp) , except
that AbstractTraining.threadNPArgAugmentations(danbikel.lisp.Sexp) is invoked
after all other preprocessing methods. |
Sexp |
Training.preProcess(Sexp tree)
|
Sexp |
Training.relabelSubjectlessSentences(Sexp tree)
We override Training.relabelSubjectlessSentences(Sexp)
so that we can make the definition of a subjectless sentence slightly more
restrictive: a subjectless sentence not only must have a null-element child
that is marked with the subject augmentation, but also its head must be a
VP (this is Mike Collins' definition of a subjectless sentence). |
protected Sexp |
BrokenTraining.unrepairBaseNPs(Sexp tree)
De-transforms NPs that were transformed by the Training.repairBaseNPs(Sexp) method. |
protected Sexp |
Training.unrepairBaseNPs(Sexp tree)
Attempts to un-do the transformation performed by AbstractTraining.repairBaseNPs(Sexp) , in which sentential nodes that occur to the right of
the head child of a base NP are moved to become immediate right siblings of
the base NP; accordingly, this method moves all such sentential nodes that
occur immediately to the right of a base NP to be the rightmost child under
that base NP. |
Methods in danbikel.parser.english with parameters of type Sexp | |
---|---|
int |
BrokenHeadFinder.findHead(Sexp tree,
Symbol lhs,
SexpList rhs)
Finds the head for the grammar production lhs -> rhs . |
int |
HeadFinder.findHead(Sexp tree,
Symbol lhs,
SexpList rhs)
Finds the head for the grammar production lhs -> rhs . |
Sexp |
BrokenTraining.fixSubjectlessSentences(Sexp tree)
This method has been written to do nothing to the specified tree. |
Sexp |
Training.fixSubjectlessSentences(Sexp tree)
De-transforms sentence labels changed by Training.relabelSubjectlessSentences(Sexp) when the subjectless sentence
node has children prior to its head child that are arguments. |
Sexp |
BrokenTraining.identifyArguments(Sexp tree)
Marks certain nodes as arguments by appending a suffix to their respective labels. |
boolean |
BrokenTreebank.isNullElementPreterminal(Sexp tree)
Returns true if the specified S-expression represents a
preterminal whose terminal element is the null element
("-NONE-" ) for the Penn Treebank. |
boolean |
Treebank.isNullElementPreterminal(Sexp tree)
Returns true if the specified S-expression represents a
preterminal whose terminal element is the null element
("-NONE-" ) for the Penn Treebank. |
boolean |
BrokenTreebank.isPossessivePreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal that is the possessive part of speech. |
boolean |
Treebank.isPossessivePreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal that is the possessive part of speech. |
boolean |
BrokenTreebank.isPreterminal(Sexp tree)
Returns true if tree represents a preterminal
subtree (part-of-speech tag and word). |
boolean |
Treebank.isPreterminal(Sexp tree)
Returns true if tree represents a preterminal
subtree (part-of-speech tag and word). |
boolean |
BrokenTreebank.isPuncToRaise(Sexp preterm)
Returns true if the specified S-expression is a preterminal
whose part of speech is "," or
":" . |
boolean |
Treebank.isPuncToRaise(Sexp preterm)
Returns true if the specified S-expression is a preterminal
whose part of speech is "," or
":" . |
boolean |
BrokenTreebank.isVerb(Sexp preterminal)
Returns true if preterminal represents a
terminal with one of the following parts of speech: VB, VBD, VBG,
VBN, VBP or VBZ. |
boolean |
Treebank.isVerb(Sexp preterminal)
Returns true if preterminal represents a
terminal with one of the following parts of speech: VB, VBD, VBG,
VBN, VBP or VBZ. |
protected boolean |
BrokenTraining.needToAddNormalNPLevel(Sexp grandparent,
int parentIdx,
Sexp tree)
The following method has been overridden so that the two unpublished conditions under which one needs to add a normal NP level are overlooked. |
void |
BrokenTraining.postProcess(Sexp tree)
|
void |
Training.postProcess(Sexp tree)
|
Sexp |
BrokenTraining.preProcess(Sexp tree)
|
Sexp |
NPArgThreadTraining.preProcess(Sexp tree)
Identical to Training.preProcess(danbikel.lisp.Sexp) , except
that AbstractTraining.threadNPArgAugmentations(danbikel.lisp.Sexp) is invoked
after all other preprocessing methods. |
Sexp |
Training.preProcess(Sexp tree)
|
Sexp |
Training.relabelSubjectlessSentences(Sexp tree)
We override Training.relabelSubjectlessSentences(Sexp)
so that we can make the definition of a subjectless sentence slightly more
restrictive: a subjectless sentence not only must have a null-element child
that is marked with the subject augmentation, but also its head must be a
VP (this is Mike Collins' definition of a subjectless sentence). |
protected Sexp |
BrokenTraining.unrepairBaseNPs(Sexp tree)
De-transforms NPs that were transformed by the Training.repairBaseNPs(Sexp) method. |
protected Sexp |
Training.unrepairBaseNPs(Sexp tree)
Attempts to un-do the transformation performed by AbstractTraining.repairBaseNPs(Sexp) , in which sentential nodes that occur to the right of
the head child of a base NP are moved to become immediate right siblings of
the base NP; accordingly, this method moves all such sentential nodes that
occur immediately to the right of a base NP to be the rightmost child under
that base NP. |
Constructors in danbikel.parser.english with parameters of type Sexp | |
---|---|
BrokenHeadFinder(Sexp headTableSexp)
Constructs an English head-finding object with the specified head table. |
|
HeadFinder(Sexp headTableSexp)
Constructs an English head-finding object with the specified head table. |
Uses of Sexp in danbikel.parser.lang |
---|
Methods in danbikel.parser.lang that return Sexp | |
---|---|
Sexp |
AbstractTraining.addBaseNPs(Sexp tree)
Adds and/or relabels base NPs, which are defined in this default implementation to be NPs that do not dominate other non-possessive NPs, where a possessive NP is defined to be an NP that itself dominates a possessive preterminal, as determined by the implementation of the method Treebank.isPossessivePreterminal(Sexp) . |
Sexp |
AbstractTraining.addGapInformation(Sexp tree)
Augments nonterminals to include gap information for WHNP's that have moved and leave traces (gaps), as in the GPSG framework. |
Sexp |
AbstractHeadFinder.addHeadInformation(Sexp tree)
Perform head-finding in tree , augmenting nodes that
are the head children of their respective parents. |
Sexp |
AbstractTreebank.constructPreterminal(Word word)
Converts a Word object into a preterminal subtree. |
Sexp |
AbstractTraining.identifyArguments(Sexp tree)
Augments labels of nonterminals that are arguments. |
Sexp |
AbstractTraining.preProcess(Sexp tree)
The method to call before counting events in a training parse tree. |
Sexp |
AbstractTraining.prune(Sexp tree)
Prunes away subtrees that have a root that is an element of nodesToPrune . |
Sexp |
AbstractTraining.raisePunctuation(Sexp tree)
Raises punctuation to the highest possible point in a parse tree, resulting in a tree where no punctuation is the first or last child of a non-leaf node. |
Sexp |
AbstractTraining.relabelSubjectlessSentences(Sexp tree)
Relabels sentences that have no subjects with the nonterminal label returned by Treebank.subjectlessSentenceLabel() . |
Sexp |
AbstractTreebank.removeAugmentation(Sexp sexp,
Nonterminal nonterminal,
Symbol augmentation)
|
Sexp |
AbstractTraining.removeGapAugmentation(Sexp sexp)
If the specified S-expression is a list, this method modifies the list to contain only symbols without gap augmentations; otherwise, this method removes the gap augmentation (if one exists) in the specified symbol and returns that new symbol. |
Sexp |
AbstractTraining.removeNullElements(Sexp tree)
Removes all null elements, that is, those nodes of tree for
which Treebank.isNullElementPreterminal(Sexp) returns
true . |
Sexp |
AbstractTraining.repairBaseNPs(Sexp tree)
Changes the specified tree so that when the last child of an NPB is an S, the S gets raised to be a sibling immediately following the NPB. |
protected Sexp |
AbstractTraining.repairBaseNPs(Sexp grandparent,
int parentIdx,
Sexp tree)
Changes the specified tree so that when the last child of an NPB is an S, the S gets raised to be a sibling immediately following the NPB. |
Sexp |
AbstractTraining.stripAugmentations(Sexp tree)
Strips any augmentations off all of the nonterminal labels of tree . |
protected Sexp |
AbstractTraining.threadNPArgAugmentations(Sexp tree)
Adds any argument augmentations on an NP to its head child, continuing recursively until reaching a preterminal. |
Sexp |
AbstractTraining.transformSubjectNTs(Sexp tree)
Transforms nonterminals marked with a subject augmentation so that their unaugmented base label is the concatenation of the original base label plus the subject augmentation. |
Methods in danbikel.parser.lang with parameters of type Sexp | |
---|---|
Sexp |
AbstractTraining.addBaseNPs(Sexp tree)
Adds and/or relabels base NPs, which are defined in this default implementation to be NPs that do not dominate other non-possessive NPs, where a possessive NP is defined to be an NP that itself dominates a possessive preterminal, as determined by the implementation of the method Treebank.isPossessivePreterminal(Sexp) . |
Sexp |
AbstractTraining.addGapInformation(Sexp tree)
Augments nonterminals to include gap information for WHNP's that have moved and leave traces (gaps), as in the GPSG framework. |
Sexp |
AbstractHeadFinder.addHeadInformation(Sexp tree)
Perform head-finding in tree , augmenting nodes that
are the head children of their respective parents. |
protected void |
AbstractTraining.canonicalizeNonterminals(Sexp tree)
Modifies each nonterminal in the specified tree to be its canonical version. |
protected void |
AbstractTraining.collectPreterms(Set preterms,
Sexp tree)
Adds all preterminal subtrees to the specified set. |
int |
AbstractHeadFinder.findHead(Sexp tree)
Finds the head for the production at the root of the specified subtree. |
abstract int |
AbstractHeadFinder.findHead(Sexp tree,
Symbol lhs,
SexpList rhs)
Finds the head for the grammar production lhs -> rhs . |
Symbol |
AbstractTreebank.getTag(Sexp preterminal)
Gets the component of the preterminal tree that corresponds to the part of speech tag. |
int |
AbstractTreebank.getTraceIndex(Sexp preterm,
Nonterminal nonterminal)
Returns the index of a trace for the specified null element preterminal. |
protected int |
AbstractTraining.hasGap(Sexp tree,
Sexp root,
ArrayList indexStack)
Returns -1 if tree has no gap (trace), or the index of the
trace otherwise. |
protected boolean |
AbstractTraining.hasPossessiveChild(Sexp tree)
Returns true if tree contains a child for which
Treebank.isPossessivePreterminal(Sexp) returns
true , false otherwise. |
Sexp |
AbstractTraining.identifyArguments(Sexp tree)
Augments labels of nonterminals that are arguments. |
boolean |
AbstractTraining.isAllNodesToPrune(Sexp tree)
Returns whether all words or preterminals of this tree are to be pruned. |
boolean |
AbstractTreebank.isAugDelim(Sexp sexp)
|
protected boolean |
AbstractTraining.isCoordinatedPhrase(Sexp tree,
int headIdx)
Returns true if a non-head child of the specified
tree is a conjunction, and that conjunction is either post-head
but non-final, or immediately pre-head but non-initial (where
"immediately pre-head" means "at the first index
less than headIdx that is not punctuation, as determined
by Treebank.isPunctuation(Symbol) ). |
abstract boolean |
AbstractTreebank.isNullElementPreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal whose terminal element is the null element for this
language’s Treebank. |
abstract boolean |
AbstractTreebank.isPossessivePreterminal(Sexp tree)
Returns true if the specified S-expression represents
a preterminal that is the possessive part of speech. |
abstract boolean |
AbstractTreebank.isPreterminal(Sexp tree)
Returns whether tree represents a preterminal subtree in the
parse trees for this language's Treebank. |
abstract boolean |
AbstractTreebank.isPuncToRaise(Sexp preterm)
Returns true if the specified S-expression represents
a preterminal and a part-of-speech tag that indicates punctuation
to be raised when running Training.raisePunctuation(Sexp) . |
boolean |
AbstractTraining.isValidTree(Sexp tree)
Returns true if tree is a preterminal (the base
case) or is a list with the first element of type Symbol (the
node label) and subsequent elements are valid trees (the recursive case). |
abstract boolean |
AbstractTreebank.isVerb(Sexp preterminal)
Returns true if the specified preterminal is that of a verb. |
Word |
AbstractTreebank.makeWord(Sexp preterminal)
Constructs a Word object from the specified preterminal
subtree. |
protected boolean |
AbstractTraining.needToAddNormalNPLevel(Sexp grandparent,
int parentIdx,
Sexp tree)
Returns true if a unary NP needs to be added above the
specified base NP. |
void |
AbstractTraining.postProcess(Sexp tree)
|
Sexp |
AbstractTraining.preProcess(Sexp tree)
The method to call before counting events in a training parse tree. |
Sexp |
AbstractTraining.prune(Sexp tree)
Prunes away subtrees that have a root that is an element of nodesToPrune . |
Sexp |
AbstractTraining.raisePunctuation(Sexp tree)
Raises punctuation to the highest possible point in a parse tree, resulting in a tree where no punctuation is the first or last child of a non-leaf node. |
protected void |
AbstractHeadFinder.readHeadTable(Sexp headTableSexp)
Reads the head table contained in the specified S-expression. |
Sexp |
AbstractTraining.relabelSubjectlessSentences(Sexp tree)
Relabels sentences that have no subjects with the nonterminal label returned by Treebank.subjectlessSentenceLabel() . |
Sexp |
AbstractTreebank.removeAugmentation(Sexp sexp,
Nonterminal nonterminal,
Symbol augmentation)
|
Sexp |
AbstractTraining.removeGapAugmentation(Sexp sexp)
If the specified S-expression is a list, this method modifies the list to contain only symbols without gap augmentations; otherwise, this method removes the gap augmentation (if one exists) in the specified symbol and returns that new symbol. |
Sexp |
AbstractTraining.removeNullElements(Sexp tree)
Removes all null elements, that is, those nodes of tree for
which Treebank.isNullElementPreterminal(Sexp) returns
true . |
protected void |
AbstractTraining.removeOnlyChildBaseNPs(Sexp tree)
Handle case where an NP dominates a base NP and has no other children (the base NP is an "only child" of the dominating NP). |
Sexp |
AbstractTraining.repairBaseNPs(Sexp tree)
Changes the specified tree so that when the last child of an NPB is an S, the S gets raised to be a sibling immediately following the NPB. |
protected Sexp |
AbstractTraining.repairBaseNPs(Sexp grandparent,
int parentIdx,
Sexp tree)
Changes the specified tree so that when the last child of an NPB is an S, the S gets raised to be a sibling immediately following the NPB. |
String |
AbstractTraining.skip(Sexp tree)
Returns whether the specified tree is to be skipped when training. |
Sexp |
AbstractTraining.stripAugmentations(Sexp tree)
Strips any augmentations off all of the nonterminal labels of tree . |
protected Sexp |
AbstractTraining.threadNPArgAugmentations(Sexp tree)
Adds any argument augmentations on an NP to its head child, continuing recursively until reaching a preterminal. |
Sexp |
AbstractTraining.transformSubjectNTs(Sexp tree)
Transforms nonterminals marked with a subject augmentation so that their unaugmented base label is the concatenation of the original base label plus the subject augmentation. |
protected boolean |
AbstractTraining.unaryProductionsToNull(Sexp tree)
Returns whether the specified subtree consists solely of unary productions going to a null element terminal. |
Constructors in danbikel.parser.lang with parameters of type Sexp | |
---|---|
AbstractHeadFinder(Sexp headTableSexp)
Constructs a head-finding object with the specified head table. |
Uses of Sexp in danbikel.parser.util |
---|
Methods in danbikel.parser.util that return Sexp | |
---|---|
static Sexp |
Util.collectLeaves(Sexp tree)
Returns a SexpList that contains all the leaves of the
specified parse tree. |
static Sexp |
Util.collectTaggedWords(Sexp tree)
Returns a SexpList that contains all the words of the
specified parse tree as well as their part of speech tags, where each
word is its own SexpList of the form (word (tag)). |
static Sexp |
Util.ibmToPenn(Sexp sexp)
A utility method that converts the specified IBM-format tree to a Penn Treebank–format tree. |
static Sexp |
KeepNodes.keepNodes(Sexp tree,
List<Nonterminal> nodesToKeep)
|
static Sexp |
Util.readIbmTree(SexpTokenizer tok)
Returns the S-expression for the IBM-format parse tree in the stream to be tokenized by the specified SexpTokenizer instance. |
static Sexp |
DebugChart.removeChildlessNodes(Sexp tree)
Removes interior nodes of the specified tree that are not preterminals and that have no children. |
static Sexp |
DebugChart.removePreterms(SexpList words,
Sexp tree,
int wordIdx)
Removes preterminals from the specified tree that are not found in the specified list of words. |
Methods in danbikel.parser.util with parameters of type Sexp | |
---|---|
static Sexp |
Util.collectLeaves(Sexp tree)
Returns a SexpList that contains all the leaves of the
specified parse tree. |
static CountsTable |
Util.collectNonterminals(CountsTable counts,
Sexp tree,
boolean includeTags)
Adds the nonterminals in the specified tree to the specified set. |
static Sexp |
Util.collectTaggedWords(Sexp tree)
Returns a SexpList that contains all the words of the
specified parse tree as well as their part of speech tags, where each
word is its own SexpList of the form (word (tag)). |
static CountsTable |
Util.collectTags(CountsTable counts,
Sexp tree)
Adds the part of speech tags in the specified tree to the specified set. |
static ArrayList |
Util.collectWordObjects(Sexp tree)
|
static void |
DebugChart.downcaseWords(Sexp tree)
|
static void |
DebugChart.findConstituents(boolean downcaseWords,
Chart chart,
CKYItem topRankedItem,
SexpList sentence,
Sexp goldTree)
Prints out to System.err which constituents of the specified
gold-standard parse tree were found by the parser, according to the
specified chart. |
static void |
DebugChart.findConstituents(String prefix,
boolean downcaseWords,
Chart chart,
CKYItem topRankedItem,
SexpList sentence,
Sexp goldTree)
Prints out to System.err which constituents of the specified
gold-standard parse tree were found by the parser, according to the
specified chart. |
static void |
DebugChart.findConstituents(String chartFilename,
Sexp goldTree)
Prints out to System.err which constituents of the specified
gold-standard parse tree were found by the parser, according to its output
chart file. |
static Sexp |
Util.ibmToPenn(Sexp sexp)
A utility method that converts the specified IBM-format tree to a Penn Treebank–format tree. |
static Sexp |
KeepNodes.keepNodes(Sexp tree,
List<Nonterminal> nodesToKeep)
|
static String |
Util.prettyPrint(Sexp tree)
Returns a string containing the pretty-printed version of the specified parse tree. |
static Sexp |
DebugChart.removeChildlessNodes(Sexp tree)
Removes interior nodes of the specified tree that are not preterminals and that have no children. |
static Sexp |
DebugChart.removePreterms(SexpList words,
Sexp tree,
int wordIdx)
Removes preterminals from the specified tree that are not found in the specified list of words. |
static void |
DebugChart.replaceWords(boolean downcaseWords,
Sexp tree,
SexpList sentence)
|
|
Parsing Engine | |||||||||
PREV NEXT | FRAMES NO FRAMES |