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 | Protected Member Functions | List of all members
ZGen::BestFirst::SpanFactory Class Reference

#include <span_factory.h>

Public Member Functions

 SpanFactory (const Knowledge::PostagConstrain *constrain, SpanAllocator *allocator)
 
void create_initial_spans_from_input (const dependency_t *input_ref, std::vector< Span * > &spans)
 
void create_spans_from_chart (const Span *span, const SpanKMaxHeap *charts, std::vector< Span * > &spans)
 
void create_gold_spans_from_reference (const dependency_t *input, const dependency_t *reference, SpanSet &spans)
 

Protected Member Functions

virtual bool legal_to_left_combine (const Span *head, const Span *modifier) const
 
virtual bool legal_to_right_combine (const Span *head, const Span *modifier) const
 

Constructor & Destructor Documentation

ZGen::BestFirst::SpanFactory::SpanFactory ( const Knowledge::PostagConstrain constrain,
SpanAllocator allocator 
)

Member Function Documentation

void ZGen::BestFirst::SpanFactory::create_gold_spans_from_reference ( const dependency_t input,
const dependency_t reference,
SpanSet spans 
)

Enumerate all the gold spans from a reference dependency tree.

Parameters
[in]inputThe input dependency.
[in]referenceThe reference dependency.
[out]spansThe output spans.
void ZGen::BestFirst::SpanFactory::create_initial_spans_from_input ( const dependency_t input_ref,
std::vector< Span * > &  spans 
)

Make initial spans from the input data. These spans is used as initial spans to the searching process.

Parameters
[in]input_refThe input data's reference.
[out]spansThe output spans.
void ZGen::BestFirst::SpanFactory::create_spans_from_chart ( const Span span,
const SpanKMaxHeap charts,
std::vector< Span * > &  spans 
)

Make spans (namely, the transition in the search process) from the charts.

Parameters
[in]spanThe from spans.
[in]chartsThe current chart.
[out]spansThe output spans.
bool ZGen::BestFirst::SpanFactory::legal_to_left_combine ( const Span head,
const Span modifier 
) const
protectedvirtual

legal_to_left_combine and legal_to_right_combine are the functions which needed to be override for different input constrains implementation. Check if it is legal to construct a span by combining the head and the modifier as a left modifier.

Parameters
[in]headThe pointer to the head span.
[in]modifierThe pointer to the modifier span.
Returns
bool Return true when it is legal, otherwise return false.
bool ZGen::BestFirst::SpanFactory::legal_to_right_combine ( const Span head,
const Span modifier 
) const
protectedvirtual

Check if it is legal to construct a span by combining the head and the modifier as a right modifier.

Parameters
[in]headThe pointer to the head span.
[in]modifierThe pointer to the modifier span.
Returns
bool Return true when it is legal, otherwise return false.

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