00001 // vim:tabstop=2 00002 /*********************************************************************** 00003 Moses - factored phrase-based language decoder 00004 Copyright (C) 2010 Hieu Hoang 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 ***********************************************************************/ 00020 00021 #pragma once 00022 00023 #include <vector> 00024 #include "InputType.h" 00025 #include "DecodeGraph.h" 00026 #include "ChartTranslationOptionList.h" 00027 #include "ChartRuleLookupManager.h" 00028 #include "StackVec.h" 00029 00030 namespace Moses 00031 { 00032 class DecodeGraph; 00033 class Word; 00034 class ChartTranslationOption; 00035 class DottedRule; 00036 class WordPenaltyProducer; 00037 class ChartCellCollection; 00038 00044 class ChartTranslationOptionCollection 00045 { 00046 protected: 00047 const InputType &m_source; 00048 const TranslationSystem* m_system; 00049 std::vector <DecodeGraph*> m_decodeGraphList; 00050 const ChartCellCollection &m_hypoStackColl; 00051 const std::vector<ChartRuleLookupManager*> &m_ruleLookupManagers; 00052 00053 ChartTranslationOptionList m_translationOptionList; 00054 std::vector<Phrase*> m_unksrcs; 00055 std::list<TargetPhraseCollection*> m_cacheTargetPhraseCollection; 00056 StackVec m_emptyStackVec; 00057 00059 virtual void ProcessOneUnknownWord(const Word &, const WordsRange &); 00060 00061 public: 00062 ChartTranslationOptionCollection(InputType const& source 00063 , const TranslationSystem* system 00064 , const ChartCellCollection &hypoStackColl 00065 , const std::vector<ChartRuleLookupManager*> &ruleLookupManagers); 00066 virtual ~ChartTranslationOptionCollection(); 00067 void CreateTranslationOptionsForRange(const WordsRange &); 00068 00069 const ChartTranslationOptionList &GetTranslationOptionList() const { 00070 return m_translationOptionList; 00071 } 00072 00073 void Clear() { m_translationOptionList.Clear(); } 00074 00075 }; 00076 00077 }