summaryrefslogtreecommitdiff
path: root/klm/search/edge.hh
blob: 77ab0ade6a54abbce274819e3319ac818997de0e (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
25
26
27
28
29
30
31
#ifndef SEARCH_EDGE__
#define SEARCH_EDGE__

#include "lm/state.hh"
#include "search/arity.hh"
#include "search/rule.hh"
#include "search/types.hh"
#include "search/vertex.hh"

#include <queue>

namespace search {

struct PartialEdge {
  Score score;
  // Terminals
  lm::ngram::ChartState between[kMaxArity + 1];
  // Non-terminals
  PartialVertex nt[kMaxArity];

  const lm::ngram::ChartState &CompletedState() const {
    return between[0];
  }

  bool operator<(const PartialEdge &other) const {
    return score < other.score;
  }
};

} // namespace search
#endif // SEARCH_EDGE__