summaryrefslogtreecommitdiff
path: root/decoder/lattice.h
diff options
context:
space:
mode:
authorCHRISTOPHER DYER <cdyer@CHRISTOPHERs-MacBook-Pro.local>2015-02-03 21:24:07 -0500
committerCHRISTOPHER DYER <cdyer@CHRISTOPHERs-MacBook-Pro.local>2015-02-03 21:24:07 -0500
commitc7b2a39958912d7b85a384a871609e6db73042c7 (patch)
tree5405ac792a173edaa50e67750c2b10722a47962a /decoder/lattice.h
parentafd65846cf1456a8b49e8482b9a40777014f6883 (diff)
support multiple sparse features on lattice edges
Diffstat (limited to 'decoder/lattice.h')
-rw-r--r--decoder/lattice.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/decoder/lattice.h b/decoder/lattice.h
index 1258d3f5..469615b5 100644
--- a/decoder/lattice.h
+++ b/decoder/lattice.h
@@ -3,6 +3,7 @@
#include <string>
#include <vector>
+#include "sparse_vector.h"
#include "wordid.h"
#include "array2d.h"
@@ -15,10 +16,10 @@ struct LatticeTools {
struct LatticeArc {
WordID label;
- double cost;
+ SparseVector<double> features;
int dist2next;
- LatticeArc() : label(), cost(), dist2next() {}
- LatticeArc(WordID w, double c, int i) : label(w), cost(c), dist2next(i) {}
+ LatticeArc() : label(), features(), dist2next() {}
+ LatticeArc(WordID w, const SparseVector<double>& f, int i) : label(w), features(f), dist2next(i) {}
};
class Lattice : public std::vector<std::vector<LatticeArc> > {