mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 15:00:33 +03:00
get num of factors from bjam arg like the rest of moses
This commit is contained in:
parent
e2bb633632
commit
75c052dc66
@ -9,7 +9,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
typedef float SCORE;
|
||||
const size_t NUM_FACTOR = 4;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "util/murmur_hash.hh"
|
||||
|
||||
Word::Word() {
|
||||
Init<Factor*>(m_factors, NUM_FACTOR, NULL);
|
||||
Init<Factor*>(m_factors, MAX_NUM_FACTORS, NULL);
|
||||
}
|
||||
|
||||
Word::~Word() {
|
||||
@ -20,12 +20,12 @@ Word::~Word() {
|
||||
size_t Word::hash() const
|
||||
{
|
||||
uint64_t seed = 0;
|
||||
size_t ret = util::MurmurHashNative(m_factors, sizeof(Factor*) * NUM_FACTOR, seed);
|
||||
size_t ret = util::MurmurHashNative(m_factors, sizeof(Factor*) * MAX_NUM_FACTORS, seed);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Word::operator==(const Word &compare) const
|
||||
{
|
||||
int cmp = memcmp(m_factors, compare.m_factors, sizeof(Factor*) * NUM_FACTOR);
|
||||
int cmp = memcmp(m_factors, compare.m_factors, sizeof(Factor*) * MAX_NUM_FACTORS);
|
||||
return cmp == 0;
|
||||
}
|
||||
|
@ -19,6 +19,6 @@ public:
|
||||
bool operator==(const Word &compare) const;
|
||||
|
||||
protected:
|
||||
Factor *m_factors[NUM_FACTOR];
|
||||
Factor *m_factors[MAX_NUM_FACTORS];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user