summaryrefslogtreecommitdiff
path: root/klm/alone/labeled_edge.hh
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-09-12 15:07:44 +0100
committerKenneth Heafield <github@kheafield.com>2012-09-12 15:07:44 +0100
commit173910593bf6bf3dc52902f99a683560d8c73942 (patch)
tree746ea920283178f3bf6b7f86e7b9e6b195821676 /klm/alone/labeled_edge.hh
parent143ba7317dcaee3058d66f9e6558316f88f95212 (diff)
Add the alone stuff, using a wrapper to the edge class.
Diffstat (limited to 'klm/alone/labeled_edge.hh')
-rw-r--r--klm/alone/labeled_edge.hh30
1 files changed, 30 insertions, 0 deletions
diff --git a/klm/alone/labeled_edge.hh b/klm/alone/labeled_edge.hh
new file mode 100644
index 00000000..94d8cbdf
--- /dev/null
+++ b/klm/alone/labeled_edge.hh
@@ -0,0 +1,30 @@
+#ifndef ALONE_LABELED_EDGE__
+#define ALONE_LABELED_EDGE__
+
+#include "search/edge.hh"
+
+#include <string>
+#include <vector>
+
+namespace alone {
+
+class LabeledEdge : public search::Edge {
+ public:
+ LabeledEdge() {}
+
+ void AppendWord(const std::string *word) {
+ words_.push_back(word);
+ }
+
+ const std::vector<const std::string *> &Words() const {
+ return words_;
+ }
+
+ private:
+ // NULL for non-terminals.
+ std::vector<const std::string*> words_;
+};
+
+} // namespace alone
+
+#endif // ALONE_LABELED_EDGE__