ZGen  0.2.0
a linearization system for natural language.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
ZGen::BestFirst::Span Struct Reference

#include <span.h>

Public Member Functions

 Span ()
 
void init (const dependency_t *ref, int root_id, postag_t tag)
 
void copy (const Span *other)
 
void clear ()
 
bool complete ()
 
bool link_left (const Span *modifier)
 
bool link_right (const Span *modifier)
 
void repr (std::string &s) const
 

Public Attributes

bool initialized
 
const dependency_tref
 
int root_id
 
postag_t tag
 
floatval_t score
 
std::vector< const Span * > left_spans
 
std::vector< const Span * > right_spans
 
std::bitset< kMaxNumberOfWordsused_words
 

Friends

std::ostream & operator<< (std::ostream &os, const Span &span)
 

Constructor & Destructor Documentation

ZGen::BestFirst::Span::Span ( )

Member Function Documentation

void ZGen::BestFirst::Span::clear ( )

Clear the information stored in the span, including clear the left and right spans, set the initialized flag false.

bool ZGen::BestFirst::Span::complete ( )

Return if the span is a complete span. A complete span is

Returns
bool Return true if the span is a complete span, otherwise return false.
void ZGen::BestFirst::Span::copy ( const Span other)

Copy the context of the other span into this span.

Parameters
[in]otherThe other span.
void ZGen::BestFirst::Span::init ( const dependency_t ref,
int  root_id,
postag_t  tag 
)

Initialize the span with input information, including set the init flag to true.

Parameters
[in]refThe reference to the input dependency.
[in]root_idThe index to the root.
[in]tagThe postag.
bool ZGen::BestFirst::Span::link_left ( const Span modifier)

Link the left modifier span into the current span.

Parameters
[in]modifierThe left modifier.
Returns
bool Return true if successfully linked, otherwise false.
bool ZGen::BestFirst::Span::link_right ( const Span modifier)

Link the right modifier span into the current span.

Parameters
[in]modifierThe right modifier.
Returns
bool Return true if successfully linked, otherwise false.
void ZGen::BestFirst::Span::repr ( std::string &  s) const

Represent the span in string.

Parameters
[out]sThe output string.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Span span 
)
friend

Member Data Documentation

bool ZGen::BestFirst::Span::initialized

The initialized flag

std::vector<const Span *> ZGen::BestFirst::Span::left_spans

The left modifiers

const dependency_t* ZGen::BestFirst::Span::ref

The reference to the input

std::vector<const Span *> ZGen::BestFirst::Span::right_spans

The right modifiers

int ZGen::BestFirst::Span::root_id

The index for the root

floatval_t ZGen::BestFirst::Span::score

The score of the current span

postag_t ZGen::BestFirst::Span::tag

The postag tag to the root of the span

std::bitset<kMaxNumberOfWords> ZGen::BestFirst::Span::used_words

The used words


The documentation for this struct was generated from the following files: