diff options
Diffstat (limited to 'mgizapp')
-rw-r--r-- | mgizapp/src/AlignTables.h | 2 | ||||
-rw-r--r-- | mgizapp/src/hmm.cpp | 5 | ||||
-rw-r--r-- | mgizapp/src/ttableDiff.hpp | 10 | ||||
-rw-r--r-- | mgizapp/src/utility.cpp | 8 |
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 |