FreeLing
4.0
|
Class chart contains an array of cells that constitute a chart. More...
#include <chart.h>
Public Member Functions | |
chart (const grammar &) | |
constructor | |
~chart () | |
destructor | |
int | get_size () const |
Get size of the table. | |
void | load_sentence (const sentence &, int k=0) |
load sentece and init parsing (fill up first row of chart) | |
void | parse () |
Do the parsing. | |
parse_tree | get_tree (int, int, const std::wstring &=L"") const |
navigate through the chart and obtain a parse tree. | |
Private Member Functions | |
bool | better_edge (const edge &, const edge &) const |
compare two edges when extracting a tree | |
std::list< std::pair< int, int > > | cover (int a, int b) const |
obtain a list of cells that cover the subtree under cell (a,b) | |
int | index (int i, int j) const |
compute position of the cell inside the vector | |
bool | can_extend (const std::wstring &, int, int) const |
find out whether the cell (i,j) has some inactive edge whose head is the given category | |
void | find_all_rules (const edge &, cell &, int, int) const |
Complete edges in a cell (ce) after inserting a terminal or an inactive edge, using rules whose right part starts with the right token (which may be wildcarded) | |
bool | check_match (const std::wstring &, const std::wstring &) const |
check match between a (possibly) wildcarded string and a literal. | |
void | dump () const |
Private Attributes | |
std::vector< cell > | table |
chart table | |
int | size |
dimension of the chart table (length of the sentece to parse) | |
const grammar & | gram |
grammar to use |
Class chart contains an array of cells that constitute a chart.
freeling::chart::chart | ( | const grammar & | ) |
constructor
destructor
bool freeling::chart::better_edge | ( | const edge & | , |
const edge & | |||
) | const [private] |
compare two edges when extracting a tree
bool freeling::chart::can_extend | ( | const std::wstring & | , |
int | , | ||
int | |||
) | const [private] |
find out whether the cell (i,j) has some inactive edge whose head is the given category
bool freeling::chart::check_match | ( | const std::wstring & | , |
const std::wstring & | |||
) | const [private] |
check match between a (possibly) wildcarded string and a literal.
std::list<std::pair<int,int> > freeling::chart::cover | ( | int | a, |
int | b | ||
) | const [private] |
obtain a list of cells that cover the subtree under cell (a,b)
void freeling::chart::dump | ( | ) | const [private] |
void freeling::chart::find_all_rules | ( | const edge & | , |
cell & | , | ||
int | , | ||
int | |||
) | const [private] |
Complete edges in a cell (ce) after inserting a terminal or an inactive edge, using rules whose right part starts with the right token (which may be wildcarded)
int freeling::chart::get_size | ( | ) | const |
Get size of the table.
parse_tree freeling::chart::get_tree | ( | int | , |
int | , | ||
const std::wstring & | = L"" |
||
) | const |
navigate through the chart and obtain a parse tree.
int freeling::chart::index | ( | int | i, |
int | j | ||
) | const [private] |
compute position of the cell inside the vector
void freeling::chart::load_sentence | ( | const sentence & | , |
int | k = 0 |
||
) |
load sentece and init parsing (fill up first row of chart)
void freeling::chart::parse | ( | ) |
Do the parsing.
const grammar& freeling::chart::gram [private] |
grammar to use
int freeling::chart::size [private] |
dimension of the chart table (length of the sentece to parse)
std::vector<cell> freeling::chart::table [private] |
chart table