2010-07-18 03:23:09 +04:00
|
|
|
// $Id$
|
2010-04-12 14:15:49 +04:00
|
|
|
// vim:tabstop=2
|
|
|
|
/***********************************************************************
|
|
|
|
Moses - factored phrase-based language decoder
|
|
|
|
Copyright (C) 2010 Hieu Hoang
|
2011-02-24 15:36:50 +03:00
|
|
|
|
2010-04-12 14:15:49 +04:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2011-02-24 15:36:50 +03:00
|
|
|
|
2010-04-12 14:15:49 +04:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2011-02-24 15:36:50 +03:00
|
|
|
|
2010-04-12 14:15:49 +04:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
***********************************************************************/
|
|
|
|
|
2010-04-08 21:16:10 +04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
2011-03-11 16:08:43 +03:00
|
|
|
#include "Phrase.h"
|
2010-04-08 21:16:10 +04:00
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
2011-02-24 15:36:50 +03:00
|
|
|
class ScoreComponentCollection;
|
2011-03-11 16:08:43 +03:00
|
|
|
class ChartHypothesis;
|
2011-11-08 15:28:02 +04:00
|
|
|
class ChartTrellisDetour;
|
2010-04-08 21:16:10 +04:00
|
|
|
|
2012-06-27 03:45:02 +04:00
|
|
|
/** 1 node in the output hypergraph. Used in ChartTrellisPath
|
|
|
|
*/
|
2011-03-11 16:08:43 +03:00
|
|
|
class ChartTrellisNode
|
2010-04-08 21:16:10 +04:00
|
|
|
{
|
2011-11-08 15:28:02 +04:00
|
|
|
public:
|
2011-03-11 16:08:43 +03:00
|
|
|
typedef std::vector<ChartTrellisNode*> NodeChildren;
|
2010-04-08 21:16:10 +04:00
|
|
|
|
2011-11-08 15:28:02 +04:00
|
|
|
ChartTrellisNode(const ChartHypothesis &hypo);
|
|
|
|
ChartTrellisNode(const ChartTrellisDetour &, ChartTrellisNode *&);
|
|
|
|
|
2011-03-11 16:08:43 +03:00
|
|
|
~ChartTrellisNode();
|
2011-02-24 15:36:50 +03:00
|
|
|
|
2011-11-08 15:28:02 +04:00
|
|
|
const ChartHypothesis &GetHypothesis() const { return m_hypo; }
|
2011-02-24 15:36:50 +03:00
|
|
|
|
2011-11-08 15:28:02 +04:00
|
|
|
const NodeChildren &GetChildren() const { return m_children; }
|
2011-02-24 15:36:50 +03:00
|
|
|
|
2011-11-08 15:28:02 +04:00
|
|
|
const ChartTrellisNode &GetChild(size_t i) const { return *m_children[i]; }
|
2011-02-24 15:36:50 +03:00
|
|
|
|
2011-03-11 19:28:36 +03:00
|
|
|
Phrase GetOutputPhrase() const;
|
2011-11-08 15:28:02 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
ChartTrellisNode(const ChartTrellisNode &); // Not implemented
|
|
|
|
ChartTrellisNode& operator=(const ChartTrellisNode &); // Not implemented
|
|
|
|
|
|
|
|
ChartTrellisNode(const ChartTrellisNode &, const ChartTrellisNode &,
|
|
|
|
const ChartHypothesis &, ChartTrellisNode *&);
|
|
|
|
|
|
|
|
void CreateChildren();
|
|
|
|
void CreateChildren(const ChartTrellisNode &, const ChartTrellisNode &,
|
|
|
|
const ChartHypothesis &, ChartTrellisNode *&);
|
|
|
|
|
|
|
|
const ChartHypothesis &m_hypo;
|
|
|
|
NodeChildren m_children;
|
2010-04-08 21:16:10 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|