mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Merge branch 'master' of https://github.com/moses-smt/mosesdecoder
Conflicts: moses/LM/IRST.cpp
This commit is contained in:
commit
8424fb6e2a
@ -42,9 +42,9 @@ namespace Moses
|
||||
class Murmur: public DALM::State::HashFunction
|
||||
{
|
||||
public:
|
||||
Murmur(std::size_t seed=0): seed(seed){
|
||||
Murmur(std::size_t seed=0): seed(seed) {
|
||||
}
|
||||
virtual std::size_t operator()(const DALM::VocabId *words, std::size_t size) const{
|
||||
virtual std::size_t operator()(const DALM::VocabId *words, std::size_t size) const {
|
||||
return util::MurmurHashNative(words, sizeof(DALM::VocabId) * size, seed);
|
||||
}
|
||||
private:
|
||||
@ -301,7 +301,7 @@ void LanguageModelDALM::CalcScore(const Phrase &phrase, float &fullScore, float
|
||||
}
|
||||
|
||||
currPos++;
|
||||
if (currPos >= m_ContextSize){
|
||||
if (currPos >= m_ContextSize) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -564,7 +564,7 @@ void LanguageModelDALM::EvaluateTerminal(
|
||||
} else {
|
||||
hypoScore += score;
|
||||
prefixLength++;
|
||||
if(state.get_count() < std::min(prevLen+1, (int)m_ContextSize)){
|
||||
if(state.get_count() < std::min(prevLen+1, (int)m_ContextSize)) {
|
||||
newState->SetAsLarge();
|
||||
}
|
||||
if(prefixLength >= m_ContextSize) newState->SetAsLarge();
|
||||
@ -626,7 +626,7 @@ void LanguageModelDALM::EvaluateNonTerminal(
|
||||
state = prevState->GetRightContext();
|
||||
return;
|
||||
} else if(state.get_count() <= prefixPos+1) {
|
||||
if(state.get_count() == prefixPos+1 && !gap.is_finalized()){
|
||||
if(state.get_count() == prefixPos+1 && !gap.is_finalized()) {
|
||||
prefixLength++;
|
||||
}
|
||||
newState->SetAsLarge();
|
||||
@ -636,7 +636,7 @@ void LanguageModelDALM::EvaluateNonTerminal(
|
||||
newState->SetAsLarge();
|
||||
} else {
|
||||
prefixLength++;
|
||||
if(state.get_count() < std::min(prevLen+1, (int)m_ContextSize)){
|
||||
if(state.get_count() < std::min(prevLen+1, (int)m_ContextSize)) {
|
||||
newState->SetAsLarge();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user