| Tanl Linguistic Pipeline |
Extract features for SST. More...
#include <SstFeatureExtractor.h>
Public Member Functions | |
| SstFeatureExtractor (Resources &resources) | |
| void | analyze (Sentence *sent, int zone) |
| Set the sentence from which to extract features. | |
| void | extract (Classifier::Features &feats, const int &pos) |
| Extract features at position pos in sentence and put them into . | |
| void | reset () |
| Reset to initial state. | |
| void | classified (int position, char const *className) |
| Record that a token at given position has been classified in the given class. | |
Protected Attributes | |
| Resources & | resources |
| bool | insideQuotes |
| TokenCategorizer | tokenCategorizer |
| extracts token type | |
| std::vector< EntityType > | tokenTypes |
| types of sentence tokens | |
| Sentence * | sentence |
| sentence being analyzed | |
| unordered_map< string, bool > | capitalized |
| Words that appeared previously as capitalized. | |
| Tanl::Text::NormWordSet | prevClass [NUM_CLASSES] |
| List of words previously designated as given class. | |
| Tanl::Text::NormWordSet | otherLast [NUM_CLASSES] |
| other word in Cap sequence is in Last Words | |
| Tanl::Text::NormWordSet | acronyms |
| List of previously found acronyms. | |
Extract features for SST.
| void Tanl::SST::SstFeatureExtractor::analyze | ( | Sentence * | sent, | |
| int | zone | |||
| ) |
Set the sentence from which to extract features.
References Tanl::SST::TokenCategorizer::analyze(), Tanl::Token::form, sentence, tokenCategorizer, and tokenTypes.
Referenced by Tanl::SST::SstEventStream::analyze().
| void Tanl::SST::SstFeatureExtractor::extract | ( | Classifier::Features & | feats, | |
| const int & | pos | |||
| ) | [virtual] |
Extract features at position pos in sentence and put them into .
Local features include:
Implements Tanl::Classifier::FeatureExtractor< Classifier::Features, const int >.
References acronyms, Tanl::Token::attrIndex(), capitalized, Tanl::Text::NormWordSet::contains(), Tanl::Token::form, Tanl::Token::get(), Tanl::Text::NormWordSet::insert(), Tanl::SST::Resources::nClasses, otherLast, prevClass, Tanl::Text::RegExp::Pattern::replace(), sentence, and Tanl::Text::to_upper().
Referenced by Tanl::SST::SstEventStream::next().
| void Tanl::SST::SstFeatureExtractor::reset | ( | ) | [virtual] |
Reset to initial state.
Useful when reading several documents with the same tagger instance.
Reimplemented from Tanl::Classifier::FeatureExtractor< Classifier::Features, const int >.
References acronyms, capitalized, Tanl::SST::Resources::nClasses, otherLast, and prevClass.
Referenced by Tanl::SST::SstEventStream::reset().
unordered_map<string, bool> Tanl::SST::SstFeatureExtractor::capitalized [protected] |