#ifndef _TARGET_PHRASE_EXTRACTOR_H_ #define _TARGET_PHRASE_EXTRACTOR_H_ #include #include #include using namespace std; class Alignment; class DataArray; class Phrase; class PhraseBuilder; class RuleExtractorHelper; class Vocabulary; typedef vector > PhraseAlignment; class TargetPhraseExtractor { public: TargetPhraseExtractor(shared_ptr target_data_array, shared_ptr alignment, shared_ptr phrase_builder, shared_ptr helper, shared_ptr vocabulary, int max_rule_span, bool require_tight_phrases); virtual ~TargetPhraseExtractor(); virtual vector > ExtractPhrases( const vector >& target_gaps, const vector& target_low, int target_phrase_low, int target_phrase_high, const unordered_map& source_indexes, int sentence_id) const; protected: TargetPhraseExtractor(); private: void GeneratePhrases( vector >& target_phrases, const vector >& ranges, int index, vector& subpatterns, const vector& target_gap_order, int target_phrase_low, int target_phrase_high, const unordered_map& source_indexes, int sentence_id) const; shared_ptr target_data_array; shared_ptr alignment; shared_ptr phrase_builder; shared_ptr helper; shared_ptr vocabulary; int max_rule_span; bool require_tight_phrases; }; #endif