src/Generic/theories/EntitySet.cpp
/** An EntitySet is a collection of Entities.  But in addition to that, it 
  * contains some extra variables, none of which need to be serialized:
  * 
  *   - entitiesByType, undetEntities: pre-indexed subsets of the entity list.
  *   - prevMentionSets, curMentionSets: copies of (or pointers to) the
  *     mention sets of the individual sentences.  I *believe* that these
  *     should always be direct (unmodified) copies of the mentions that
  *     appear in the sentence; therefore, we don't need to serialize them.
  *   - _nSentences: the number of sentences in the document (used to allocate
  *     the right amount of space for prevMentionSets)
  *   - _nPrevMentionSets: the number of prevMentionSets that have been
  *     filled in with meaningful values.
  */
An EntitySet is a collection of Entities.  But in addition to that, it
contains some extra variables, none of which need to be serialized.

- entitiesByType, undetEntities: pre-indexed subsets of the entity list.
- prevMentionSets, curMentionSets: copies of (or pointers to) the
mention sets of the individual sentences.  I *believe* that these
should always be direct (unmodified) copies of the mentions that
appear in the sentence; therefore, we don't need to serialize them.
- _nSentences: the number of sentences in the document (used to allocate
the right amount of space for prevMentionSets)
- _nPrevMentionSets: the number of prevMentionSets that have been
filled in with meaningful values.
An EntitySet is a collection of Entities . But in addition to that it contains some extra variables none of which need to be serialized . - entitiesByType undetEntities : pre - indexed subsets of the entity list . - prevMentionSets curMentionSets : copies of ( or pointers to ) the mention sets of the individual sentences . I * believe * that these should always be direct ( unmodified ) copies of the mentions that appear in the sentence ; therefore we don ' t need to serialize them . - _nSentences : the number of sentences in the document ( used to allocate the right amount of space for prevMentionSets ) - _nPrevMentionSets : the number of prevMentionSets that have been filled in with meaningful values .
void EntitySet::saveXML(SerifXML::XMLTheoryElement entitysetElem, const Theory *context) const {
	using namespace SerifXML;
	if (context != 0)
		throw InternalInconsistencyException("EntitySet::saveXML", "Expected context to be NULL");
	entitysetElem.setAttribute(X_score, _score);
	for (int i = 0; i < getNEntities(); ++i) {
		entitysetElem.saveChildTheory(X_Entity, _entities[i], this); 
		if (_entities[i]->ID != i)
			throw InternalInconsistencyException("EntitySet::saveXML", 
				"Unexpected Entity::ID value");
	}
}
void EntitySet :: saveXML ( SerifXML :: XMLTheoryElement entitysetElem , const Theory * context ) const { using namespace SerifXML ; if ( context != 0 ) throw InternalInconsistencyException ( " " , " " ) ; entitysetElem . setAttribute ( X_score , _score ) ; for ( int i = 0 ; i < getNEntities ( ) ; ++ i ) { entitysetElem . saveChildTheory ( X_Entity , _entities [ i ] , this ) ; if ( _entities [ i ] -> ID != i ) throw InternalInconsistencyException ( " " , " " ) ; } }
An EntitySet is a collection of Entities.
An EntitySet is a collection of Entities .