summaryrefslogtreecommitdiff
path: root/decoder/hg_io.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-16 22:08:37 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-16 22:08:37 +0000
commitd484433d9ad566076b7d078c77443ce7841f4f3e (patch)
tree6d6eb905ed25589821b7bec12a38b1fb211c37b1 /decoder/hg_io.cc
parent0a11da06831d5a062b6703f1aa1431cc33689e23 (diff)
smallvector template
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@302 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/hg_io.cc')
-rw-r--r--decoder/hg_io.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/decoder/hg_io.cc b/decoder/hg_io.cc
index 6a5561e6..d6e73b8a 100644
--- a/decoder/hg_io.cc
+++ b/decoder/hg_io.cc
@@ -27,7 +27,7 @@ struct HGReader : public JSONParser {
hg.ConnectEdgeToHeadNode(&hg.edges_[in_edges[i]], node);
}
}
- void CreateEdge(const TRulePtr& rule, SparseVector<double>* feats, const SmallVector& tail) {
+ void CreateEdge(const TRulePtr& rule, FeatureVector* feats, const SmallVectorInt& tail) {
Hypergraph::Edge* edge = hg.AddEdge(rule, tail);
feats->swap(edge->feature_values_);
edge->i_ = spans[0];
@@ -228,7 +228,7 @@ struct HGReader : public JSONParser {
}
string rp;
string cat;
- SmallVector tail;
+ SmallVectorInt tail;
vector<int> in_edges;
TRulePtr cur_rule;
map<int, TRulePtr> rules;
@@ -524,7 +524,7 @@ void ReadPLFNode(const std::string& in, int &c, int cur_node, int line, Hypergra
}
}
-} // namespace PLF
+} // namespace PLF
void HypergraphIO::ReadFromPLF(const std::string& in, Hypergraph* hg, int line) {
hg->clear();
@@ -644,7 +644,7 @@ void b64encode(const char* data, const size_t size, ostream* out) {
}
}
-static void decodeblock(const unsigned char* in, unsigned char* out) {
+static void decodeblock(const unsigned char* in, unsigned char* out) {
out[0] = (unsigned char ) (in[0] << 2 | in[1] >> 4);
out[1] = (unsigned char ) (in[1] << 4 | in[2] >> 2);
out[2] = (unsigned char ) (((in[2] << 6) & 0xc0) | in[3]);