mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +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>
|
#include <cstddef>
|
||||||
|
|
||||||
typedef float SCORE;
|
typedef float SCORE;
|
||||||
const size_t NUM_FACTOR = 4;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "util/murmur_hash.hh"
|
#include "util/murmur_hash.hh"
|
||||||
|
|
||||||
Word::Word() {
|
Word::Word() {
|
||||||
Init<Factor*>(m_factors, NUM_FACTOR, NULL);
|
Init<Factor*>(m_factors, MAX_NUM_FACTORS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Word::~Word() {
|
Word::~Word() {
|
||||||
@ -20,12 +20,12 @@ Word::~Word() {
|
|||||||
size_t Word::hash() const
|
size_t Word::hash() const
|
||||||
{
|
{
|
||||||
uint64_t seed = 0;
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Word::operator==(const Word &compare) const
|
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;
|
return cmp == 0;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,6 @@ public:
|
|||||||
bool operator==(const Word &compare) const;
|
bool operator==(const Word &compare) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Factor *m_factors[NUM_FACTOR];
|
Factor *m_factors[MAX_NUM_FACTORS];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user