init moses2

This commit is contained in:
Hieu Hoang 2015-10-23 18:33:12 +01:00
parent 5d851f3838
commit f467e60fe0
6 changed files with 57 additions and 10 deletions

View File

@ -5,8 +5,7 @@
* Author: hieu
*/
#ifndef FACTOR_H_
#define FACTOR_H_
#pragma once
#include "util/string_piece.hh"
#include "util/string_piece_hash.hh"
@ -23,7 +22,7 @@ public:
}
inline bool operator==(const Factor &compare) const {
return m_string == &compare.m_string;
return m_string == compare.m_string;
}
protected:
@ -31,4 +30,3 @@ protected:
};
#endif /* FACTOR_H_ */

View File

@ -0,0 +1,15 @@
#include <iostream>
#include "StaticData.cpp"
#include "Word.h"
using namespace std;
int main()
{
cerr << "Starting..." << endl;
//StaticData sd;
//Word w;
cerr << "Finished" << endl;
}

View File

@ -0,0 +1,18 @@
/*
* StaticData.cpp
*
* Created on: 23 Oct 2015
* Author: hieu
*/
#include "StaticData.h"
StaticData::StaticData() {
// TODO Auto-generated constructor stub
}
StaticData::~StaticData() {
// TODO Auto-generated destructor stub
}

View File

@ -0,0 +1,15 @@
/*
* StaticData.h
*
* Created on: 23 Oct 2015
* Author: hieu
*/
#pragma once
class StaticData {
public:
StaticData();
virtual ~StaticData();
};

View File

@ -9,8 +9,8 @@
#define VOCAB_H_
#include <boost/unordered_set.hpp>
#include "util/string_piece.hh"
#include "moses/Util.h"
//#include "util/string_piece.hh"
//#include "moses/Util.h"
class Vocab {
public:
@ -21,13 +21,13 @@ public:
Vocab();
virtual ~Vocab();
const Factor *AddFactor(const StringPiece &factorString);
//const Factor *AddFactor(const StringPiece &factorString);
protected:
static Vocab s_instance;
typedef boost::unordered_set<Factor*, Moses::UnorderedComparer<Factor>, Moses::UnorderedComparer<Factor>> Set;
Set m_set;
//typedef boost::unordered_set<Factor*, Moses::UnorderedComparer<Factor>, Moses::UnorderedComparer<Factor>> Set;
//Set m_set;
};

View File

@ -1 +1,2 @@
g++ -I../../.. -I../../../boost/include StaticData.cpp Factor.cpp Word.cpp
#g++ -I../../.. -I../../../boost/include Factor.cpp Word.cpp StaticData.cpp Main.cpp
g++ -I../../.. -I../../../boost/include StaticData.cpp Main.cpp