mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
c01783869a
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/branches/mira-mtm5@3463 1f5c12ca-751b-0410-a591-d2e778427230
72 lines
2.1 KiB
C++
72 lines
2.1 KiB
C++
/***********************************************************************
|
|
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
|
|
***********************************************************************/
|
|
#ifndef _MIRA_DECODER_H_
|
|
#define _MIRA_DECODER_H_
|
|
|
|
#include <iostream>
|
|
#include <cstring>
|
|
#include <sstream>
|
|
|
|
|
|
#include "Hypothesis.h"
|
|
#include "Parameter.h"
|
|
#include "Sentence.h"
|
|
#include "SearchNormal.h"
|
|
#include "StaticData.h"
|
|
#include "TrellisPathList.h"
|
|
#include "TranslationOptionCollectionText.h"
|
|
|
|
//
|
|
// Wrapper functions and objects for the decoder.
|
|
//
|
|
|
|
namespace Mira {
|
|
|
|
typedef std::vector<const Moses::Factor*> Translation;
|
|
|
|
/**
|
|
* Initialise moses (including StaticData) using the given ini file and debuglevel, passing through any
|
|
* other command line arguments. This must be called, even if the moses decoder is not being used, as the
|
|
* sampler requires the moses tables.
|
|
**/
|
|
void initMoses(const std::string& inifile, int debuglevel, int argc=0, char** argv=NULL );
|
|
|
|
|
|
/**
|
|
* Wrapper around any decoder.
|
|
**/
|
|
class Decoder {
|
|
public:
|
|
virtual void getNBest(const std::string& source, size_t count, Moses::TrellisPathList& sentences) = 0;
|
|
virtual ~Decoder();
|
|
};
|
|
/**
|
|
* Wraps moses decoder.
|
|
**/
|
|
class MosesDecoder : public Decoder {
|
|
public:
|
|
MosesDecoder() {}
|
|
virtual void getNBest(const std::string& source, size_t count, Moses::TrellisPathList& sentences);
|
|
};
|
|
|
|
|
|
} //namespace
|
|
|
|
#endif
|