/* $Id: predicate.cc 1107 2007-04-16 23:59:13Z rvernica $ Copyright (C) 2007 by The Regents of the University of California Redistribution of this file is permitted under the terms of the GNU Public License (GPL). Date: 01/14/2006 Author: Rares Vernica */ #include "predicate.h" #include using namespace std; istream& operator>>(istream &in, Predicate &p) { char buf[DATASET_LEN]; in.get(buf, DATASET_LEN, in.widen('\t')); p.query.assign(buf); in >> p.dist >> p.freq; in.getline(buf, DATASET_LEN, in.widen('\n')); return in; } istream& operator>>(istream &in, VectPredicate &v) { unsigned n; in>>n; char buf[DATASET_LEN]; in.getline(buf, DATASET_LEN, in.widen('\n')); in.getline(buf, DATASET_LEN, in.widen('\n')); for (unsigned i=0; i>p; v.push_back(p); } return in; } ostream& operator<<(ostream &out, const Predicate &p) { return out<(v.size())<(out, "\n")); return out; }