src/PredFinder/elf/ElfDocument.cpp
/**
 * Public accessor to get all individuals, or individuals
 * having a particular type. Returns copies of the underlying
 * ElfIndividuals, so changing any of the return values doesn't
 * change the contents of the document. Individuals are organized
 * by their containing sentence.
 *
 * @param search_type The optional ontology type to find
 * individuals by; if not specified, all individuals are returned.
 * @return A vector of sorted sets; each vector bucket corresponds
 * to the sentence of the same index, containing just those individuals
 * whose type assertion offsets are within the bounds of that sentence.
 *
 * @author nward@bbn.com
 * @date 2011.01.06
 **/
Public accessor to get all individuals, or individuals
having a particular type. Returns copies of the underlying
ElfIndividuals, so changing any of the return values doesn't
change the contents of the document. Individuals are organized
by their containing sentence.

@param search_type The optional ontology type to find
individuals by; if not specified, all individuals are returned.
@return A vector of sorted sets; each vector bucket corresponds
to the sentence of the same index, containing just those individuals
whose type assertion offsets are within the bounds of that sentence.


Public accessor to get all individuals or individuals having a particular type . Returns copies of the underlying ElfIndividuals so changing any of the return values doesn ' t change the contents of the document . Individuals are organized by their containing sentence . @param search_type The optional ontology type to find individuals by ; if not specified all individuals are returned . @return A vector of sorted sets ; each vector bucket corresponds to the sentence of the same index containing just those individuals whose type assertion offsets are within the bounds of that sentence .
std::vector<ElfIndividualSet> ElfDocument::get_individuals_by_type_and_sentence(const DocTheory* doc_theory, 
																				const std::wstring & search_type) const 
{
	std::vector<ElfIndividualSet> individuals_by_sentence;
	individuals_by_sentence.resize(doc_theory->getNSentences());
	ElfIndividualSet individuals = get_merged_individuals_by_type(search_type);
	BOOST_FOREACH(ElfIndividual_ptr individual, individuals) {
		int sent_no, start_token, end_token;
		EDTOffset start_offset, end_offset;
		individual->get_spanning_offsets(start_offset, end_offset);
		bool token_align = MainUtilities::getSerifStartEndTokenFromCharacterOffsets(doc_theory, start_offset, end_offset, sent_no, 
			start_token, end_token);
		if (token_align)
			individuals_by_sentence[sent_no].insert(individual);
	}
	return individuals_by_sentence;
}
std :: vector < ElfIndividualSet > ElfDocument :: get_individuals_by_type_and_sentence ( const DocTheory * doc_theory , const std :: wstring & search_type ) const { std :: vector < ElfIndividualSet > individuals_by_sentence ; individuals_by_sentence . resize ( doc_theory -> getNSentences ( ) ) ; ElfIndividualSet individuals = get_merged_individuals_by_type ( search_type ) ; BOOST_FOREACH ( ElfIndividual_ptr individual , individuals ) { int sent_no , start_token , end_token ; EDTOffset start_offset , end_offset ; individual -> get_spanning_offsets ( start_offset , end_offset ) ; bool token_align = MainUtilities :: getSerifStartEndTokenFromCharacterOffsets ( doc_theory , start_offset , end_offset , sent_no , start_token , end_token ) ; if ( token_align ) individuals_by_sentence [ sent_no ] . insert ( individual ) ; } return individuals_by_sentence ; }
Public accessor to get all individuals, or individuals
 having a particular type.
Public accessor to get all individuals or individuals having a particular type .
// Selected individuals
 // Loop over all of the individuals that have the specified type and sort them by sentence
 // Find the sentence containing the individual's type provenance
 // Only sentence-level cluster individuals we can align
 // Don't need to make a copy, since the returns of get_individuals_by_type are already copies
 // Done
