mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 22:14:57 +03:00
bug fix domain features
This commit is contained in:
parent
106bad253c
commit
28e8832a15
@ -30,7 +30,7 @@ protected:
|
||||
public:
|
||||
float pcfgSum;
|
||||
float count;
|
||||
size_t sentenceId;
|
||||
int sentenceId;
|
||||
std::string domain;
|
||||
|
||||
std::vector< std::set<size_t> > alignedToT;
|
||||
|
@ -272,12 +272,16 @@ int main(int argc, char* argv[])
|
||||
lastPcfgSum = phrasePair.pcfgSum;
|
||||
|
||||
// only differs in count? just add count
|
||||
if (lastPhrasePair != NULL && lastPhrasePair->equals( phrasePair )) {
|
||||
if (lastPhrasePair != NULL
|
||||
&& lastPhrasePair->equals( phrasePair )
|
||||
&& (!domainFlag
|
||||
|| domain->getDomainOfSentence( lastPhrasePair->sentenceId )
|
||||
== domain->getDomainOfSentence( phrasePair.sentenceId ) )) {
|
||||
lastPhrasePair->count += phrasePair.count;
|
||||
lastPhrasePair->pcfgSum += phrasePair.pcfgSum;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// if new source phrase, process last batch
|
||||
if (lastPhrasePair != NULL &&
|
||||
lastPhrasePair->GetSource() != phrasePair.GetSource()) {
|
||||
|
Loading…
Reference in New Issue
Block a user