2010-04-13 19:34:39 +04:00
|
|
|
/***********************************************************************
|
|
|
|
Moses - factored phrase-based language decoder
|
|
|
|
Copyright (C) 2010 University of Edinburgh
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#ifndef SENTENCEALIGNMENTWITHSYNTAX_H_INCLUDED_
|
|
|
|
#define SENTENCEALIGNMENTWITHSYNTAX_H_INCLUDED_
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "RuleExtractionOptions.h"
|
|
|
|
#include "SentenceAlignment.h"
|
2015-05-29 22:57:25 +03:00
|
|
|
#include "SyntaxNodeCollection.h"
|
2010-04-13 19:34:39 +04:00
|
|
|
|
2012-06-30 18:43:47 +04:00
|
|
|
namespace MosesTraining
|
|
|
|
{
|
|
|
|
|
2010-04-13 19:34:39 +04:00
|
|
|
class SentenceAlignmentWithSyntax : public SentenceAlignment
|
|
|
|
{
|
2011-02-24 16:57:11 +03:00
|
|
|
public:
|
2015-05-29 20:46:02 +03:00
|
|
|
SyntaxNodeCollection targetTree;
|
|
|
|
SyntaxNodeCollection sourceTree;
|
2011-02-24 16:57:11 +03:00
|
|
|
std::set<std::string> & m_targetLabelCollection;
|
|
|
|
std::set<std::string> & m_sourceLabelCollection;
|
|
|
|
std::map<std::string, int> & m_targetTopLabelCollection;
|
|
|
|
std::map<std::string, int> & m_sourceTopLabelCollection;
|
|
|
|
const RuleExtractionOptions & m_options;
|
|
|
|
|
|
|
|
SentenceAlignmentWithSyntax(std::set<std::string> & tgtLabelColl,
|
|
|
|
std::set<std::string> & srcLabelColl,
|
|
|
|
std::map<std::string,int> & tgtTopLabelColl,
|
|
|
|
std::map<std::string,int> & srcTopLabelColl,
|
|
|
|
const RuleExtractionOptions & options)
|
|
|
|
: m_targetLabelCollection(tgtLabelColl)
|
|
|
|
, m_sourceLabelCollection(srcLabelColl)
|
|
|
|
, m_targetTopLabelCollection(tgtTopLabelColl)
|
|
|
|
, m_sourceTopLabelCollection(srcTopLabelColl)
|
2013-06-10 21:11:55 +04:00
|
|
|
, m_options(options) {
|
|
|
|
}
|
2011-02-24 16:57:11 +03:00
|
|
|
|
2012-05-06 01:11:25 +04:00
|
|
|
virtual ~SentenceAlignmentWithSyntax() {}
|
|
|
|
|
2011-02-24 16:57:11 +03:00
|
|
|
bool
|
2012-08-23 22:40:09 +04:00
|
|
|
processTargetSentence(const char *, int, bool boundaryRules);
|
2011-02-24 16:57:11 +03:00
|
|
|
|
|
|
|
bool
|
2012-08-23 22:40:09 +04:00
|
|
|
processSourceSentence(const char *, int, bool boundaryRules);
|
2010-04-13 19:34:39 +04:00
|
|
|
};
|
|
|
|
|
2012-06-30 18:43:47 +04:00
|
|
|
}
|
|
|
|
|
2010-04-13 19:34:39 +04:00
|
|
|
#endif
|