예제 #1
0
void MaxEntTrainer::Add_Event(EventSet &events, const char *name, const char *data)
{
	const string delims(" ");

	MaxEntEvent	*event	= new MaxEntEvent;
	getIds(data, *event, delims);
	event->classId(getClassId(name));
	event->count(1);
	events.push_back(event);
}
예제 #2
0
void MaxEntTrainer::readEvents(istream& istrm, EventSet& events)
{
  string line, cls;
  const string delims(" ");
  while ((istrm>>cls) && getline(istrm, line)) {
    MaxEntEvent* event = new MaxEntEvent;
    getIds(line, *event, delims);
    event->classId(getClassId(cls));
    event->count(1);
    events.push_back(event);
  }
}