summaryrefslogtreecommitdiff
path: root/klm/search/edge.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/search/edge.hh')
-rw-r--r--klm/search/edge.hh31
1 files changed, 31 insertions, 0 deletions
diff --git a/klm/search/edge.hh b/klm/search/edge.hh
new file mode 100644
index 00000000..77ab0ade
--- /dev/null
+++ b/klm/search/edge.hh
@@ -0,0 +1,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__