ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Private Member Functions | List of all members
meta::parser::sr_parser::state_analyzer Class Reference

Analyzer responsible for converting a parser state to a feature_vector. More...

#include <state_analyzer.h>

Public Member Functions

feature_vector featurize (const state &state) const
 Maps a state to its feature vector representation.
 

Private Member Functions

void unigram_featurize (const state &state, feature_vector &feats) const
 Adds unigram features. More...
 
void bigram_featurize (const state &state, feature_vector &feats) const
 Adds bigram features. More...
 
void trigram_featurize (const state &state, feature_vector &feats) const
 Adds trigram features. More...
 
void children_featurize (const state &state, feature_vector &feats) const
 Adds children features. More...
 
void dependents_featurize (const state &state, feature_vector &feats) const
 Adds dependent features. More...
 
void unigram_stack_feats (const node *n, std::string prefix, feature_vector &feats) const
 Adds unigram features from the parser stack. More...
 
void bigram_features (const node *n1, std::string name1, const node *n2, std::string name2, feature_vector &feats) const
 Adds bigram features to the feature vector. More...
 
void child_feats (const node *n, std::string prefix, feature_vector &feats, bool doubs) const
 Adds child features to the feature vector. More...
 

Detailed Description

Analyzer responsible for converting a parser state to a feature_vector.

Member Function Documentation

void meta::parser::sr_parser::state_analyzer::unigram_featurize ( const state state,
feature_vector feats 
) const
private

Adds unigram features.

Parameters
stateThe current parser state
featsThe feature vector to put features in
void meta::parser::sr_parser::state_analyzer::bigram_featurize ( const state state,
feature_vector feats 
) const
private

Adds bigram features.

Parameters
stateThe current parser state
featsThe feature vector to put features in
void meta::parser::sr_parser::state_analyzer::trigram_featurize ( const state state,
feature_vector feats 
) const
private

Adds trigram features.

Parameters
stateThe current parser state
featsThe feature vector to put features in
void meta::parser::sr_parser::state_analyzer::children_featurize ( const state state,
feature_vector feats 
) const
private

Adds children features.

Parameters
stateThe current parser state
featsThe feature vector to put features in
void meta::parser::sr_parser::state_analyzer::dependents_featurize ( const state state,
feature_vector feats 
) const
private

Adds dependent features.

Parameters
stateThe current parser state
featsThe feature vector to put features in
void meta::parser::sr_parser::state_analyzer::unigram_stack_feats ( const node n,
std::string  prefix,
feature_vector feats 
) const
private

Adds unigram features from the parser stack.

Parameters
nThe node from the stack
prefixThe feature name prefix
featsThe feature vector to put features in
void meta::parser::sr_parser::state_analyzer::bigram_features ( const node n1,
std::string  name1,
const node n2,
std::string  name2,
feature_vector feats 
) const
private

Adds bigram features to the feature vector.

Parameters
n1The first node
name1The feature name prefix for the first node
n2The second node
name2The feature name prefix of the second node
featsThe feature vector put features in
void meta::parser::sr_parser::state_analyzer::child_feats ( const node n,
std::string  prefix,
feature_vector feats,
bool  doubs 
) const
private

Adds child features to the feature vector.

Parameters
nThe node to add child features for
prefixThe feature name prefix
featsThe feature vector to put features in
doubsWhether or not to add features for children two steps down

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