Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SymbolEqualityPred.h « Syntax « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 684d70cee41347145d19345271427fca79378970 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "moses/Factor.h"
#include "moses/Word.h"

namespace Moses
{
namespace Syntax
{

// Assumes that only the first factor is relevant.  i.e. factored decoding will
// *not* work in moses_chart unless this is changed (among other things).
class SymbolEqualityPred
{
public:
  bool operator()(const Word &s1, const Word &s2) const {
    const Factor *f1 = s1[0];
    const Factor *f2 = s2[0];
    return !(f1->Compare(*f2));
  }
};

}  // namespace Syntax
}  // namespace Moses