src/MaxEntSimulatedActiveLearning/InstanceSet.cpp
// enforces the SentenceInfo being in this InstanceSet, and adds the instance

enforces the SentenceInfo being in this InstanceSet, and adds the instance
enforces the SentenceInfo being in this InstanceSet and adds the instance
void InstanceSet::addInstance(RelationInstance* instance) {
	if (contains(instance))
		return;
	DTRelSentenceInfo* info = instance->getSentenceInfo();
	if (!contains(info))
		addSentenceInfo(info);
	_instances.push_back(instance);
	_uidToInstance[instance->getID()] = instance;
	_sentenceInfoToRelations[info].push_back(instance);
}
void InstanceSet :: addInstance ( RelationInstance * instance ) { if ( contains ( instance ) ) return ; DTRelSentenceInfo * info = instance -> getSentenceInfo ( ) ; if ( ! contains ( info ) ) addSentenceInfo ( info ) ; _instances . push_back ( instance ) ; _uidToInstance [ instance -> getID ( ) ] = instance ; _sentenceInfoToRelations [ info ] . push_back ( instance ) ; }
enforces the SentenceInfo being in this InstanceSet, and adds the instance
enforces the SentenceInfo being in this InstanceSet and adds the instance