ModErn Text Analysis
META Enumerates Textual Applications
Classes | Functions
meta::parser Namespace Reference

Contains functions that relate to phrase structure trees and parsing of natural language. More...

Classes

class  annotation_remover
 A tree transformer that removes annotations (currently only Penn Treebank style) from trees. More...
 
class  binarizer
 A tree transformer that converts any n-ary productions to binary productions using provided head annotations. More...
 
class  const_visitor
 Abstract base class for visitors over parse trees that do not modify the underlying tree. More...
 
class  debinarizer
 A tree transformer that converts binarized trees back into n-ary trees. More...
 
class  empty_remover
 A tree transformer that removes trace elements (like "-NONE-" in the Penn Treebank) as well as nodes with empty yields. More...
 
class  evalb
 A re-implementation of (some of) the evalb metrics. More...
 
class  head_finder
 A visitor that annotates the internal nodes of parse trees with their head constituents/lexicons. More...
 
struct  head_rule
 
class  internal_node
 An internal node in a parse tree. More...
 
class  leaf_node
 A leaf node (pre-terminal) in a parse tree. More...
 
class  leaf_node_finder
 This is a visitor that finds all of the leaf nodes in a parse tree. More...
 
class  multi_transformer
 A template class for composing tree transformers. More...
 
class  node
 A single node in a parse tree for a sentence. More...
 
class  parse_tree
 Represents the parse tree for a sentence. More...
 
class  sequence_extractor
 This is a visitor that converts a parse tree into a POS-tagged sequence. More...
 
class  sr_parser
 A shift-reduce constituency parser. More...
 
class  state
 Represents the current parser state of a shift-reduce parser. More...
 
class  transition
 Represents a transition taken by the parser. More...
 
class  transition_finder
 This is a visitor that converts a parse tree into a list of transitions that a shift-reduce parser would have to take in order to generate it. More...
 
class  transition_map
 An invertible map that maps transitions to ids. More...
 
class  tree_transformer
 Abstract base class for tree transformers. More...
 
class  unary_chain_remover
 Transforms trees by removing any unary X -> X rules. More...
 
class  visitor
 Abstract base class for visitors over parse trees that are allowed to modify the underlying tree. More...
 

Functions

void register_analyzers ()
 Register analyzers provided by the meta-parser-analyzers library.
 
std::ostream & operator<< (std::ostream &os, const transition &trans)
 Prints a transition to the stream. More...
 
std::ostream & operator<< (std::ostream &os, const transition::type_t type)
 Prints a transition type to the stream. More...
 
template<class... Transformers>
multi_transformer< Transformers...> make_transformer (std::unique_ptr< Transformers >...trans)
 Helper function for constructing a multi_transformer from a set of pointers to transformers. More...
 
std::ostream & operator<< (std::ostream &os, const parse_tree &tree)
 
bool operator== (const parse_tree &lhs, const parse_tree &rhs)
 

Detailed Description

Contains functions that relate to phrase structure trees and parsing of natural language.

Function Documentation

std::ostream & meta::parser::operator<< ( std::ostream &  os,
const transition trans 
)

Prints a transition to the stream.

Parameters
osThe stream to print to
transThe transition to be printed
Returns
the stream
std::ostream & meta::parser::operator<< ( std::ostream &  os,
const transition::type_t  type 
)

Prints a transition type to the stream.

Parameters
osThe stream to print to
typeThe transition type to print
Returns
the stream
template<class... Transformers>
multi_transformer<Transformers...> meta::parser::make_transformer ( std::unique_ptr< Transformers >...  trans)

Helper function for constructing a multi_transformer from a set of pointers to transformers.

Parameters
transThe transformers to be used
Returns
a multi_transformer with the supplied transforms
std::ostream& meta::parser::operator<< ( std::ostream &  os,
const parse_tree tree 
)

This is non-indented.

Parameters
osThe stream to print to
treeThe tree to be printed
Returns
the stream
bool meta::parser::operator== ( const parse_tree lhs,
const parse_tree rhs 
)
Parameters
lhsThe left hand side of the expression
rhsThe right hand side of the expression
Returns
whether the two parse trees are equivalent