Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mgiza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoredwardgao <edwardgao@9a26d1b7-1c8f-445c-8fdd-6576f508279d>2011-12-31 02:23:10 +0400
committeredwardgao <edwardgao@9a26d1b7-1c8f-445c-8fdd-6576f508279d>2011-12-31 02:23:10 +0400
commit3406a6081d2173b4d47f788825d4a854a62c2698 (patch)
tree230b3172b1205d279112158bb5b517bf29e89530
parent4d210b9dd09daf3c6897c462b56297c799dda571 (diff)
Linux compatible
-rw-r--r--mgizapp/src/AlignTables.h2
-rw-r--r--mgizapp/src/hmm.cpp5
-rw-r--r--mgizapp/src/ttableDiff.hpp10
-rw-r--r--mgizapp/src/utility.cpp8
4 files changed, 18 insertions, 7 deletions
diff --git a/mgizapp/src/AlignTables.h b/mgizapp/src/AlignTables.h
index 78c77e4..fcca7a6 100644
--- a/mgizapp/src/AlignTables.h
+++ b/mgizapp/src/AlignTables.h
@@ -144,7 +144,7 @@ public:
// void printTable(const char* filename);
inline void resize(WordIndex n) {
#ifndef WIN32
- return a.resize();
+ a.resize(n);
#endif
}; // resize table
diff --git a/mgizapp/src/hmm.cpp b/mgizapp/src/hmm.cpp
index a5f33cb..3b104a3 100644
--- a/mgizapp/src/hmm.cpp
+++ b/mgizapp/src/hmm.cpp
@@ -478,7 +478,12 @@ void hmm::em_loop(Perplexity& perp, sentenceHandler& sHandler1,
CLASSIFY(i,i_empty,ireal);
bi[i]+= *gp2;
}
+#ifdef WIN32
bi0.second->unlock();
+#else
+ bi0.second.unlock();
+#endif
+
if( Verbose )
cout << "l: " << l << "m: " << m << " p0c: " << p0c << " np0c: " << np0c << endl;
}
diff --git a/mgizapp/src/ttableDiff.hpp b/mgizapp/src/ttableDiff.hpp
index 419c990..280cadd 100644
--- a/mgizapp/src/ttableDiff.hpp
+++ b/mgizapp/src/ttableDiff.hpp
@@ -31,6 +31,11 @@
#include "types.h"
using namespace std;
+#ifdef WIN32
+ typedef hash_map<wordPairIds, COUNT, hashpair> wordpair_hash;
+#else
+ typedef hash_map<wordPairIds, COUNT, hashpair, equal_to<wordPairIds> > wordpair_hash;
+#endif
/*!
This class is meant to create a difference file in order to make
GIZA paralell.
@@ -42,11 +47,6 @@ private:
INT32 noFrenchWords; // total number of unique target words
/*!
Store only the counting*/
-#ifdef WIN32
- typedef hash_map<wordPairIds, COUNT, hashpair> wordpair_hash;
-#else
- typedef hash_map<wordPairIds, COUNT, hashpair, equal_to<wordPairIds> > wordpair_hash;
-#endif
wordpair_hash ef;
public:
diff --git a/mgizapp/src/utility.cpp b/mgizapp/src/utility.cpp
index dcbc5ce..15b4783 100644
--- a/mgizapp/src/utility.cpp
+++ b/mgizapp/src/utility.cpp
@@ -32,9 +32,15 @@ double factorial(int n)
f *= i;
return f;
}
-
+#ifdef WIN32
string my_ctime(const time_t* t){
char buffer[256];
ctime_s(buffer,256,t);
return buffer;
}
+#else
+
+string my_ctime(const time_t* t){
+ return ctime(t);
+}
+#endif