Skip to content

Commit

Permalink
Work-around for temporary translation option collection size during p…
Browse files Browse the repository at this point in the history
…hrase table binarization
  • Loading branch information
emjotde committed Jan 19, 2015
1 parent 7c507bf commit 7d9013a
Show file tree
Hide file tree
Showing 3 changed files with 437 additions and 6 deletions.
6 changes: 3 additions & 3 deletions moses/TranslationModel/CompactPT/PhraseTableCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ PhraseTableCreator::PhraseTableCreator(std::string inPath,

if(tempfilePath.size()) {
MmapAllocator<unsigned char> allocEncoded(util::FMakeTemp(tempfilePath));
m_encodedTargetPhrases = new StringVector<unsigned char, unsigned long, MmapAllocator>(allocEncoded);
m_encodedTargetPhrases = new StringVectorTemp<unsigned char, unsigned long, MmapAllocator>(allocEncoded);
} else {
m_encodedTargetPhrases = new StringVector<unsigned char, unsigned long, MmapAllocator>();
m_encodedTargetPhrases = new StringVectorTemp<unsigned char, unsigned long, MmapAllocator>();
}
EncodeTargetPhrases();

Expand Down Expand Up @@ -1210,7 +1210,7 @@ size_t CompressionTask::m_collectionNum = 0;
boost::mutex CompressionTask::m_mutex;
#endif

CompressionTask::CompressionTask(StringVector<unsigned char, unsigned long,
CompressionTask::CompressionTask(StringVectorTemp<unsigned char, unsigned long,
MmapAllocator>& encodedCollections,
PhraseTableCreator& creator)
: m_encodedCollections(encodedCollections), m_creator(creator) {}
Expand Down
7 changes: 4 additions & 3 deletions moses/TranslationModel/CompactPT/PhraseTableCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

#include "BlockHashIndex.h"
#include "StringVector.h"
#include "StringVectorTemp.h"
#include "CanonicalHuffman.h"

namespace Moses
Expand Down Expand Up @@ -237,7 +238,7 @@ class PhraseTableCreator
std::vector<size_t> m_lexicalTableIndex;
std::vector<SrcTrg> m_lexicalTable;

StringVector<unsigned char, unsigned long, MmapAllocator>*
StringVectorTemp<unsigned char, unsigned long, MmapAllocator>*
m_encodedTargetPhrases;

StringVector<unsigned char, unsigned long, MmapAllocator>*
Expand Down Expand Up @@ -396,12 +397,12 @@ class CompressionTask
static boost::mutex m_mutex;
#endif
static size_t m_collectionNum;
StringVector<unsigned char, unsigned long, MmapAllocator>&
StringVectorTemp<unsigned char, unsigned long, MmapAllocator>&
m_encodedCollections;
PhraseTableCreator& m_creator;

public:
CompressionTask(StringVector<unsigned char, unsigned long, MmapAllocator>&
CompressionTask(StringVectorTemp<unsigned char, unsigned long, MmapAllocator>&
encodedCollections, PhraseTableCreator& creator);
void operator()();
};
Expand Down
Loading

0 comments on commit 7d9013a

Please sign in to comment.