Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

BilexMTree Class Reference

#include <BilexMTree.H>

Inheritance diagram for BilexMTree:

Inheritance graph
[legend]
Collaboration diagram for BilexMTree:

Collaboration graph
[legend]
List of all members.

Public Types

typedef BilexMTree SyntaxTree
 Syntax Tree.
enum  HeirLayout { NODELTAS, CROSSWAYS, WHOLEDIM, ONEDELTA }

Static Public Member Functions

static void InitBilexMTreeData (BilexMTreeData &data)
 Initializes the BilexMTreeData.
static void printBilexMTree (ostream &out, BilexMTree::iterator it, const BilexMTree &tr)
 Prints a subtree.
static void flipTree (BilexMTree &tree)
 reverse the dimensions.
static void flipTree_helper (BilexMTree::iterator it)
 reverse the dimensions helper.
static void delexTree (BilexMTree &tree)
 delexicalize the tree (hack of setting to 0).
static void delexTree_helper (BilexMTree::iterator it)
 helper for delexicalization.
static void extractTLinks (BilexMTree &tree, Histogram< TLink > &w2wHist)
 extract the TLinks from this tree and return them in a histogram
static void extractTLinks_helper (BilexMTree::iterator it, Histogram< TLink > &w2wHist)
 helper to extract tlinks
static BilexMTree::HeirLayout getCaseNumber (TLink &antTLink1, TLink &antTLink2, int &posDelta)
static void indentPrint (ostream &out, const BilexMTree &tr, vector< StringVocabulary * > ntsets, vector< StringVocabulary * > terminalSets, bool ptbII=false, bool newline=true)
static void indentPrint_helper (ostream &, const BilexMTree &tr, BilexMTree::iterator it, vector< StringVocabulary * > ntsets, vector< StringVocabulary * > terminalSets, int ind, bool ptbII=false, bool newline=true)
static void printTxtBilexMTree (ostream &out, const BilexMTree &tr, vector< StringVocabulary * > ntsets, vector< StringVocabulary * > terminalSets, bool ptbII=false)
static void printTxtBilexMTree_helper (ostream &, const BilexMTree &tr, BilexMTree::iterator it, vector< StringVocabulary * > ntsets, vector< StringVocabulary * > terminalSets, bool ptbII=false)
static void print (ostream &out, const BilexMTreeData &data, vector< StringVocabulary * > ntsets, vector< StringVocabulary * > terminalsets, bool ptbII)
static void readBilexMTreeTxt (istream &in, BilexMTree::iterator it, BilexMTree &tr, vector< StringVocabulary * > &ntsets, vector< StringVocabulary * > &terminalSets)
static void readBilexMTreeDataTxt (istream &in, BilexMTreeData &data, vector< StringVocabulary * > &ntsets, vector< StringVocabulary * > &terminalSets)
static void readBilexMTree (istream &in, BilexMTree::iterator it, BilexMTree &tr)
static void positionTree2LexTree (BilexMTree &tr, const SentenceTuple &snt)
 Converts a positionTree to a Multitree.
static void lexTree2PositTree (BilexMTree &tr, BilexMTree::iterator root)
static void getLeftIters (BilexMTree::iterator &tr, DIMTYPE &d, vector< BilexMTree::iterator > &ret)
static SentenceTuple yield (const BilexMTree &st)
 Gets the yield of the BilexMTree and returns it in a SentenceTuple.
static void yield_helper (ObservationSequence< Terminal > &os, BilexMTree::iterator it, unsigned int segment, DIMTYPE d)
 recursive helper function for yield
static void removeUnaryBranch (BilexMTree &tr, vector< StringVocabulary * > synCatVcbs=vector< StringVocabulary * >())
static void removeCharniakDummyRoot (BilexMTree &tree)
static void deNull (BilexMTree &parse, BilexMTree::iterator it)
 Remove all the nulls in a MONOLINGUAL parse, and change the null head accordingly. Note that the resulting parse might contain unary.
static void copySynCats (BilexMTree &parse)
static void extendUnary (BilexMTree &tr, BilexMTree::iterator it, StringVocabulary &synCatVcb)
static void removeDummyNodes (BilexMTree &)
static void naturalize (BilexMTree &parse, StringVocabulary &synCatVcb)
static bool compare (const BilexMTree &tr1, const BilexMTree &tr2, vector< StringVocabulary * > ntset, vector< StringVocabulary * > tset)
static bool compare (const BilexMTree &tr1, const BilexMTree::iterator i, const BilexMTree &tr2, const BilexMTree::iterator j, vector< StringVocabulary * > ntset, vector< StringVocabulary * > tset)
 Helper.
static void propogatePOS (BilexMTree &tr, BilexMTree::iterator it)
 Propagate the POS upward until the root.
static void extractDependencyTree (BilexMTree &tr, BilexMTree::iterator it)
static void toDependencyTree (BilexMTree &tr)
static void delexicalize (BilexMTree &tr, Terminal &dummy, SynCat &dummyNT, SynCat &inactiveNT)
 Replace the lexical heads of all nonterminals with the dummy terminal.
static BilexMTreeassign (BilexMTree &dest, const BilexMTree &source)
 Assignment of trees.
static void assign_helper (BilexMTree &dest, BilexMTree::iterator i, const BilexMTree &source, BilexMTree::iterator j)
static bool isBasePhrase (BilexMTree::iterator &it)
static void flatten (BilexMTree::iterator it, BilexMTree &tr)
static void word2TagMap (BilexMTree &tr, hash_map< Terminal, set< SynCat > > &mapping, DIMTYPE d)
static void makeSNT (BilexMTree::iterator &tr, DIMTYPE &d, SentenceTuple &snt)
static void tags (BilexMTree &tr, HASHNS::hash_set< SynCat > &tagset, DIMTYPE d)
static void word2TagMap (BilexMTree &tr, vector< hash_map< Terminal, set< SynCat > > > &mapping)
static void reintNTs (BilexMTree &tr, vector< StringVocabulary * > newNtVcb, vector< StringVocabulary * > oldNtVcb, vector< StringVocabulary * > newTVcb, vector< StringVocabulary * > oldTVcb)
static void indent (ostream &out, size_t numsp)
static void reintNTs (BilexMTree &tr, vector< StringVocabulary * > newNtVcb, vector< StringVocabulary * > oldNtVcb)
static vector< string > denest (const string s)

Friends

istream & operator>> (istream &, BilexMTree &)
 Input of a multitree.
ostream & operator<< (ostream &, const BilexMTree &)
 Output of a multitree.
istream & operator>> (istream &, BilexMTreeData &)
ostream & operator<< (ostream &, const BilexMTreeData &)
 BilexMTreeData output.
bool operator< (const BilexMTree::iterator it1, const BilexMTree::iterator it2)
 The order of Kids.
bool operator< (const BilexMTreeData &t1, const BilexMTreeData &t2)

Classes

class  BasePhrasePredicate
class  NodePredicate

Member Typedef Documentation

typedef BilexMTree BilexMTree::SyntaxTree
 

Syntax Tree.


Member Enumeration Documentation

enum BilexMTree::HeirLayout
 

Enumeration values:
NODELTAS 
CROSSWAYS 
WHOLEDIM 
ONEDELTA 


Member Function Documentation

BilexMTree & BilexMTree::assign BilexMTree dest,
const BilexMTree source
[static]
 

Assignment of trees.

Assignment of trees.

Here is the call graph for this function:

void BilexMTree::assign_helper BilexMTree dest,
BilexMTree::iterator  i,
const BilexMTree source,
BilexMTree::iterator  j
[static]
 

Here is the call graph for this function:

bool BilexMTree::compare const BilexMTree tr1,
const BilexMTree::iterator  i,
const BilexMTree tr2,
const BilexMTree::iterator  j,
vector< StringVocabulary * >  ntset,
vector< StringVocabulary * >  tset
[static]
 

Helper.

assert(exists);

Here is the call graph for this function:

bool BilexMTree::compare const BilexMTree tr1,
const BilexMTree tr2,
vector< StringVocabulary * >  ntset,
vector< StringVocabulary * >  tset
[static]
 

Compares two parses in terms of constituent labels, spans, and heir.

void BilexMTree::copySynCats BilexMTree parse  )  [static]
 

Copy the nonterminal label from the first dim to the remaining dims in the same NTLink.

static void BilexMTree::delexicalize BilexMTree tr,
Terminal dummy,
SynCat dummyNT,
SynCat inactiveNT
[static]
 

Replace the lexical heads of all nonterminals with the dummy terminal.

void BilexMTree::delexTree BilexMTree tree  )  [static]
 

delexicalize the tree (hack of setting to 0).

Here is the call graph for this function:

void BilexMTree::delexTree_helper BilexMTree::iterator  it  )  [static]
 

helper for delexicalization.

vector< string > BilexMTree::denest const string  s  )  [static]
 

static void BilexMTree::deNull BilexMTree parse,
BilexMTree::iterator  it
[static]
 

Remove all the nulls in a MONOLINGUAL parse, and change the null head accordingly. Note that the resulting parse might contain unary.

Parameters:
parse The parse being operated on.
it The iterator pointing to the root of a subtree being operated on.

static void BilexMTree::extendUnary BilexMTree tr,
BilexMTree::iterator  it,
StringVocabulary &  synCatVcb
[static]
 

Extend a constituent label such as [A]+B into A->B. Note that this is only for monolingual parse.

void BilexMTree::extractDependencyTree BilexMTree tr,
BilexMTree::iterator  it
[static]
 

Transforms the input lexicalized constituent tree to a dependency tree. This is done by deleting all the internal heir nodes and mask all the non-terminals (excluding the part-of-speech tags). This function is applicable to multi-dimensional trees.

Here is the call graph for this function:

void BilexMTree::extractTLinks BilexMTree tree,
Histogram< TLink > &  w2wHist
[static]
 

extract the TLinks from this tree and return them in a histogram

Here is the call graph for this function:

void BilexMTree::extractTLinks_helper BilexMTree::iterator  it,
Histogram< TLink > &  w2wHist
[static]
 

helper to extract tlinks

Here is the call graph for this function:

void BilexMTree::flatten BilexMTree::iterator  it,
BilexMTree tr
[static]
 

flatten the subtree rooted at the iterator.

void BilexMTree::flipTree BilexMTree tree  )  [static]
 

reverse the dimensions.

Here is the call graph for this function:

void BilexMTree::flipTree_helper BilexMTree::iterator  it  )  [static]
 

reverse the dimensions helper.

BilexMTree::HeirLayout BilexMTree::getCaseNumber TLink antTLink1,
TLink antTLink2,
int &  posDelta
[static]
 

enumerates different layouts for deltas and tells which type the two TLinks passed in are.

void BilexMTree::getLeftIters BilexMTree::iterator tr,
DIMTYPE d,
vector< BilexMTree::iterator > &  ret
[static]
 

void BilexMTree::indent ostream &  out,
size_t  numsp
[static]
 

void BilexMTree::indentPrint ostream &  out,
const BilexMTree tr,
vector< StringVocabulary * >  ntsets,
vector< StringVocabulary * >  terminalSets,
bool  ptbII = false,
bool  newline = true
[static]
 

Indent printing.

Parameters:
out The output stream.
tr The parse tree to be output.
ntsets The set of nonterminal vocabs, each for one language.
terminalSets The set of terminal vocabs, each for one language.
ptbII If true, the output form is consistent with the PTB II format. Note that the parse tr must be monolingual when ptbII is set true.
newline whether to break lines

Here is the call graph for this function:

void BilexMTree::indentPrint_helper ostream &  ,
const BilexMTree tr,
BilexMTree::iterator  it,
vector< StringVocabulary * >  ntsets,
vector< StringVocabulary * >  terminalSets,
int  ind,
bool  ptbII = false,
bool  newline = true
[static]
 

Print a subtree rooted at iterator it. Arrangement 'ind' is the number of spaces for indent printing.

Here is the call graph for this function:

void BilexMTree::InitBilexMTreeData BilexMTreeData data  )  [static]
 

Initializes the BilexMTreeData.

bool BilexMTree::isBasePhrase BilexMTree::iterator it  )  [static]
 

Returns true if the node yields a base phrase

static void BilexMTree::lexTree2PositTree BilexMTree tr,
BilexMTree::iterator  root
[static]
 

void BilexMTree::makeSNT BilexMTree::iterator tr,
DIMTYPE d,
SentenceTuple snt
[static]
 

void BilexMTree::naturalize BilexMTree parse,
StringVocabulary &  synCatVcb
[static]
 

Naturalizes a parse tree in the way of removing dummy nodes (e.g., EOSH or ROOT), and of organizing siblings in linear order.

void BilexMTree::positionTree2LexTree BilexMTree tr,
const SentenceTuple snt
[static]
 

Converts a positionTree to a Multitree.

Here is the call graph for this function:

void BilexMTree::print ostream &  out,
const BilexMTreeData data,
vector< StringVocabulary * >  ntsets,
vector< StringVocabulary * >  terminalsets,
bool  ptbII
[static]
 

void BilexMTree::printBilexMTree ostream &  out,
BilexMTree::iterator  it,
const BilexMTree tr
[static]
 

Prints a subtree.

Here is the call graph for this function:

void BilexMTree::printTxtBilexMTree ostream &  out,
const BilexMTree tr,
vector< StringVocabulary * >  ntsets,
vector< StringVocabulary * >  terminalSets,
bool  ptbII = false
[static]
 

Print it to TXT, not integerized, format.

Parameters:
out The output stream.
tr The parse tree to be output.
ntsets The set of nonterminal vocabs, each for one language.
terminalSets The set of terminal vocabs, each for one language.
ptbII If true, the output form is consistent with the PTB II format. Note that the parse tr must be monolingual when ptbII is set true.

Here is the call graph for this function:

void BilexMTree::printTxtBilexMTree_helper ostream &  ,
const BilexMTree tr,
BilexMTree::iterator  it,
vector< StringVocabulary * >  ntsets,
vector< StringVocabulary * >  terminalSets,
bool  ptbII = false
[static]
 

Print a subtree rooted at iterator it in txt, not integerized.

Here is the call graph for this function:

void BilexMTree::propogatePOS BilexMTree tr,
BilexMTree::iterator  it
[static]
 

Propagate the POS upward until the root.

void BilexMTree::readBilexMTree istream &  in,
BilexMTree::iterator  it,
BilexMTree tr
[static]
 

Here is the call graph for this function:

void BilexMTree::readBilexMTreeDataTxt istream &  in,
BilexMTreeData data,
vector< StringVocabulary * > &  ntsets,
vector< StringVocabulary * > &  terminalSets
[static]
 

Reads a multitree data that is not integerized. This function integerizes the input and puts it in the passed in vocabs

Here is the call graph for this function:

void BilexMTree::readBilexMTreeTxt istream &  in,
BilexMTree::iterator  it,
BilexMTree tr,
vector< StringVocabulary * > &  ntsets,
vector< StringVocabulary * > &  terminalSets
[static]
 

Reads a multitree that is not integerize. This function integerizes the input and puts it in the passed in vocabs

Here is the call graph for this function:

static void BilexMTree::reintNTs BilexMTree tr,
vector< StringVocabulary * >  newNtVcb,
vector< StringVocabulary * >  oldNtVcb
[static]
 

Reintegerize the NTs in the multitree based on new NT Vocabs.

void BilexMTree::reintNTs BilexMTree tr,
vector< StringVocabulary * >  newNtVcb,
vector< StringVocabulary * >  oldNtVcb,
vector< StringVocabulary * >  newTVcb,
vector< StringVocabulary * >  oldTVcb
[static]
 

Reintegerize the NTs in the multitree based on new NT Vocabs. NTs will be added into the new NT Vocabs if they don't occur in the new ones.

Parameters:
tr The multitree.
newNtVcb The new nonterminal vocabs, each per language.
oldNtVcb The old nonterminal vocabs, each per language.
newTVcb The new terminal vocabs, each per language.
oldTVcb The old terminal vocabs, each per language.

Here is the call graph for this function:

void BilexMTree::removeCharniakDummyRoot BilexMTree tree  )  [static]
 

The Charniak dummy root in the multitree is the first kid of the multitree root.

void BilexMTree::removeDummyNodes BilexMTree  )  [static]
 

Remove the dummy root and EOS node in a parse tree of our own format.

Here is the call graph for this function:

static void BilexMTree::removeUnaryBranch BilexMTree tr,
vector< StringVocabulary * >  synCatVcbs = vector< StringVocabulary * >()
[static]
 

Remove the unary branches of the BilexMTree. For example, tree (A (B (C c))) will become (A c).

static void BilexMTree::tags BilexMTree tr,
HASHNS::hash_set< SynCat > &  tagset,
DIMTYPE  d
[static]
 

obtain the PoS tags from the tree.

void BilexMTree::toDependencyTree BilexMTree tr  )  [static]
 

Transforms the input lexicalized constituent tree to a dependency tree. This is done by deleting all the internal heir nodes and mask all the non-terminals (excluding the part-of-speech tags). This function is applicable to multi-dimensional trees.

Here is the call graph for this function:

void BilexMTree::word2TagMap BilexMTree tr,
vector< hash_map< Terminal, set< SynCat > > > &  mapping
[static]
 

Obtain a vector of word-to-tag mapping from a multitree.

Here is the call graph for this function:

void BilexMTree::word2TagMap BilexMTree tr,
hash_map< Terminal, set< SynCat > > &  mapping,
DIMTYPE  d
[static]
 

Obtain a word-to-tag mapping for the monolingual tree on component d (0-started) of the input multitree.

SentenceTuple BilexMTree::yield const BilexMTree st  )  [static]
 

Gets the yield of the BilexMTree and returns it in a SentenceTuple.

Here is the call graph for this function:

void BilexMTree::yield_helper ObservationSequence< Terminal > &  os,
BilexMTree::iterator  it,
unsigned int  segment,
DIMTYPE  d
[static]
 

recursive helper function for yield


Friends And Related Function Documentation

bool operator< const BilexMTreeData t1,
const BilexMTreeData t2
[friend]
 

bool operator< const BilexMTree::iterator  it1,
const BilexMTree::iterator  it2
[friend]
 

The order of Kids.

ostream& operator<< ostream &  out,
const BilexMTreeData data
[friend]
 

BilexMTreeData output.

ostream& operator<< ostream &  out,
const BilexMTree syncTree
[friend]
 

Output of a multitree.

istream& operator>> istream &  in,
BilexMTreeData data
[friend]
 

BilexMTreeData input. If the data indicates the heir, the heir pointer is 0x01, otherwise, it is 0x0.

istream& operator>> istream &  in,
BilexMTree tr
[friend]
 

Input of a multitree.


The documentation for this class was generated from the following files:
Generated on Thu Jul 7 23:33:44 2005 for Generalized Parsers (GenPar) by  doxygen 1.4.1