add moses2 to bjam compile

This commit is contained in:
Hieu Hoang 2015-10-25 15:58:26 +00:00
parent d8332581bb
commit 06bb79053b
10 changed files with 54 additions and 20 deletions

View File

@ -300,6 +300,7 @@ rephraser
contrib/c++tokenizer//tokenizer
contrib/expected-bleu-training//train-expected-bleu
contrib/expected-bleu-training//prepare-expected-bleu-training
contrib/other-builds/moses2
;

View File

@ -9,7 +9,7 @@
#include "Manager.h"
#include "StaticData.h"
Hypothesis::Hypothesis(const Manager &mgr, const Moses::WordsBitmap &bitmap, const Moses::WordsRange &range)
Hypothesis::Hypothesis(const Manager &mgr, const Moses::Bitmap &bitmap, const Moses::Range &range)
:m_mgr(mgr)
,m_bitmap(bitmap)
,m_range(range)

View File

@ -10,28 +10,28 @@
#include <cstddef>
#include "moses/FF/FFState.h"
#include "moses/WordsBitmap.h"
#include "moses/Bitmap.h"
class Manager;
class Hypothesis {
public:
Hypothesis(const Manager &mgr, const Moses::WordsBitmap &bitmap, const Moses::WordsRange &range);
Hypothesis(const Manager &mgr, const Moses::Bitmap &bitmap, const Moses::Range &range);
virtual ~Hypothesis();
size_t hash() const;
bool operator==(const Hypothesis &other) const;
const Moses::WordsBitmap &GetBitmap() const
const Moses::Bitmap &GetBitmap() const
{ return m_bitmap; }
const Moses::WordsRange &GetRange() const
const Moses::Range &GetRange() const
{ return m_range; }
protected:
const Manager &m_mgr;
const Moses::WordsBitmap &m_bitmap;
const Moses::WordsRange &m_range;
const Moses::Bitmap &m_bitmap;
const Moses::Range &m_range;
Moses::FFState **m_ffStates;
};

View File

@ -7,7 +7,7 @@
#include "InputPath.h"
InputPath::InputPath(const SubPhrase &subPhrase, const Moses::WordsRange &range, size_t numPt)
InputPath::InputPath(const SubPhrase &subPhrase, const Moses::Range &range, size_t numPt)
:m_subPhrase(subPhrase)
,m_range(range)
,m_targetPhrases(numPt)

View File

@ -9,23 +9,23 @@
#define INPUTPATH_H_
#include <vector>
#include "Phrase.h"
#include "moses/WordsRange.h"
#include "moses/Range.h"
class TargetPhrases;
class InputPath {
public:
InputPath(const SubPhrase &subPhrase, const Moses::WordsRange &range, size_t numPt);
InputPath(const SubPhrase &subPhrase, const Moses::Range &range, size_t numPt);
virtual ~InputPath();
const SubPhrase &GetSubPhrase() const
{ return m_subPhrase; }
const Moses::WordsRange &GetRange() const
const Moses::Range &GetRange() const
{ return m_range; }
protected:
SubPhrase m_subPhrase;
Moses::WordsRange m_range;
Moses::Range m_range;
std::vector<const TargetPhrases*> m_targetPhrases;
};

View File

@ -8,7 +8,7 @@
#include "InputPaths.h"
#include "Phrase.h"
#include "StaticData.h"
#include "moses/WordsRange.h"
#include "moses/Range.h"
using namespace std;
@ -21,7 +21,7 @@ void InputPaths::Init(const Phrase &input, const StaticData &staticData)
size_t endPos = startPos + phaseSize -1;
SubPhrase subPhrase = input.GetSubPhrase(startPos, endPos);
Moses::WordsRange range(startPos, endPos);
Moses::Range range(startPos, endPos);
InputPath path(subPhrase, range, numPt);
m_inputPaths.push_back(path);

View File

@ -0,0 +1,33 @@
# If you get compilation errors here, make sure you have xmlrpc-c
# installed properly, including the abyss server option.
import option ;
import path ;
exe moses2 :
Factor.cpp
FeatureFunction.cpp
Hypothesis.cpp
InputPath.cpp
InputPaths.cpp
Main.cpp
Manager.cpp
Phrase.cpp
PhraseTable.cpp
Scores.cpp
SearchNormal.cpp
Stack.cpp
StatefulFeatureFunction.cpp
StatelessFeatureFunction.cpp
StaticData.cpp
TargetPhrase.cpp
TargetPhrases.cpp
Vocab.cpp
Weights.cpp
Word.cpp
../../../moses//moses
../../../OnDiskPt//OnDiskPt
../../..//boost_filesystem
: <linkflags>$(xmlrpc-linkflags) <cxxflags>$(xmlrpc-cxxflags) ;

View File

@ -32,7 +32,7 @@ Manager::Manager(const StaticData &staticData, const std::string &inputStr)
void Manager::Decode()
{
const Moses::WordsBitmap &initBitmap = m_bitmaps->GetInitialBitmap();
const Moses::Bitmap &initBitmap = m_bitmaps->GetInitialBitmap();
Hypothesis *iniHypo = new (GetPool().Allocate<Hypothesis>()) Hypothesis(*this, initBitmap, m_initRange);
for (size_t i = 0; i < m_stacks.size(); ++i) {

View File

@ -44,7 +44,7 @@ protected:
Phrase *m_input;
InputPaths m_inputPaths;
Moses::Bitmaps *m_bitmaps;
Moses::WordsRange m_initRange;
Moses::Range m_initRange;
std::vector<Stack> m_stacks;
SearchNormal *m_search;

View File

@ -9,7 +9,7 @@
#include "Stack.h"
#include "Manager.h"
#include "InputPaths.h"
#include "moses/WordsBitmap.h"
#include "moses/Bitmap.h"
SearchNormal::SearchNormal(const Manager &mgr, std::vector<Stack> &stacks)
:m_mgr(mgr)
@ -46,9 +46,9 @@ void SearchNormal::Extend(const Hypothesis &hypo)
void SearchNormal::Extend(const Hypothesis &hypo, const InputPath &path)
{
const Moses::WordsBitmap &bitmap = hypo.GetBitmap();
const Moses::WordsRange &hypoRange = hypo.GetRange();
const Moses::WordsRange &pathRange = path.GetRange();
const Moses::Bitmap &bitmap = hypo.GetBitmap();
const Moses::Range &hypoRange = hypo.GetRange();
const Moses::Range &pathRange = path.GetRange();
if (bitmap.Overlap(pathRange)) {
return;