#ifndef _GRAMMAR_EXTRACTOR_H_ #define _GRAMMAR_EXTRACTOR_H_ #include #include #include "rule_factory.h" using namespace std; class Alignment; class DataArray; class Grammar; class Precomputation; class Rule; class SuffixArray; class Vocabulary; class GrammarExtractor { public: GrammarExtractor( shared_ptr source_suffix_array, shared_ptr target_data_array, shared_ptr alignment, shared_ptr precomputation, shared_ptr scorer, int min_gap_size, int max_rule_span, int max_nonterminals, int max_rule_symbols, int max_samples, bool use_baeza_yates, bool require_tight_phrases); // For testing only. GrammarExtractor(shared_ptr vocabulary, shared_ptr rule_factory); Grammar GetGrammar(const string& sentence); private: vector TokenizeSentence(const string& sentence); vector AnnotateWords(const vector& words); shared_ptr vocabulary; shared_ptr rule_factory; }; #endif