From d484433d9ad566076b7d078c77443ce7841f4f3e Mon Sep 17 00:00:00 2001 From: graehl Date: Fri, 16 Jul 2010 22:08:37 +0000 Subject: smallvector template git-svn-id: https://ws10smt.googlecode.com/svn/trunk@302 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/hg_io.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'decoder/hg_io.cc') 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* 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 in_edges; TRulePtr cur_rule; map 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]); -- cgit v1.2.3