Home | History | Annotate | Download | only in fst

Lines Matching defs:Tuple

54 // stores both the Tuple of encode labels and weights to a unique
62 struct Tuple {
63 Tuple() {}
64 Tuple(Label ilabel_, Label olabel_, Weight weight_)
66 Tuple(const Tuple& tuple)
67 : ilabel(tuple.ilabel), olabel(tuple.olabel), weight(tuple.weight) {}
74 // Comparison object for hashing EncodeTable Tuple(s).
77 bool operator()(const Tuple* x, const Tuple* y) const {
97 size_t operator()(const Tuple* x) const {
112 typedef unordered_map<const Tuple*,
132 const Tuple tuple(arc.ilabel,
135 typename EncodeHash::const_iterator it = encode_hash_.find(&tuple);
137 encode_tuples_.push_back(new Tuple(tuple));
147 const Tuple tuple(arc.ilabel,
150 typename EncodeHash::const_iterator it = encode_hash_.find(&tuple);
159 const Tuple* Decode(Label key) const {
208 vector<Tuple*> encode_tuples_;
224 const Tuple* tuple = encode_tuples_[i];
225 WriteType(strm, tuple->ilabel);
226 WriteType(strm, tuple->olabel);
227 tuple->weight.Write(strm);
264 Tuple* tuple = new Tuple();
265 ReadType(strm, &tuple->ilabel);
266 ReadType(strm, &tuple->olabel);
267 tuple->weight.Read(strm);
272 table->encode_tuples_.push_back(tuple);
448 const typename EncodeTable<A>::Tuple* tuple = table_->Decode(arc.ilabel);
449 if (!tuple) {
454 return A(tuple->ilabel,
455 flags_ & kEncodeLabels ? tuple->olabel : arc.olabel,
456 flags_ & kEncodeWeights ? tuple->weight : arc.weight,