src/PredFinder/elf/ElfRelationFactory.cpp
// RELATIONS FROM LEARNIT PATTERNS
/**
 * Static factory method that builds an ElfRelation_ptr multiset (with the relation name as the key)
 * from a set of Pattern pointers found using LearnIt patterns. 
 * Some args are filled with fake but plausible values; most are left blank. Used only for pattern validation.
 *
 * @param pattern_set The set of Pattern items containing
 * the pattern(s); may be from multiple LearnIt databases (GPEHasLeader.db, hasChild.db, etc.).
 * @param output_relations A pointer to the multiset of ElfRelation pointers that will be
 * filled by this method.
 *
 * @author afrankel@bbn.com
 * @date 2011.07.07
 **/
RELATIONS FROM LEARNIT PATTERNS
Static factory method that builds an ElfRelation_ptr multiset (with the relation name as the key)
from a set of Pattern pointers found using LearnIt patterns.
Some args are filled with fake but plausible values; most are left blank. Used only for pattern validation.

@param pattern_set The set of Pattern items containing
the pattern(s); may be from multiple LearnIt databases (GPEHasLeader.db, hasChild.db, etc.).
@param output_relations A pointer to the multiset of ElfRelation pointers that will be
filled by this method.


RELATIONS FROM LEARNIT PATTERNS Static factory method that builds an ElfRelation_ptr multiset ( with the relation name as the key ) from a set of Pattern pointers found using LearnIt patterns . Some args are filled with fake but plausible values ; most are left blank . Used only for pattern validation . @param pattern_set The set of Pattern items containing the pattern ( s ) ; may be from multiple LearnIt databases ( GPEHasLeader . db hasChild . db etc . ) . @param output_relations A pointer to the multiset of ElfRelation pointers that will be filled by this method .
void ElfRelationFactory::fake_relations_from_li_pattern_set(const std::vector<LearnItPattern_ptr> & pattern_set,
    ElfRelationMultisetSortedByName & output_relations) 
{
	bool verbose = ParamReader::getOptionalTrueFalseParamWithDefaultVal(
		"verbose_pattern_verification",  false);
	std::set<std::wstring> rel_names;
	BOOST_FOREACH(LearnItPattern_ptr pattern, pattern_set) {
        if (verbose) {
            SessionLogger::info("patt_name_1") << pattern->getTarget()->getName() << endl;
        }
        std::wstring rel_name = pattern->getTarget()->getELFOntologyType();
        std::vector< ElfRelationArg_ptr > arg_vec;
        if (rel_names.find(rel_name) == rel_names.end()) {
            fake_args_from_li_pattern(pattern, arg_vec);
            add_relation_from_arg_vec(arg_vec, pattern->getTarget()->getELFOntologyType(), 
				pattern->getTarget()->getName(), output_relations);
		} else {
			SessionLogger::info("patt_name_2") << "Relation <" << rel_name << "> already encountered.\n";
		}
    }
}
void ElfRelationFactory :: fake_relations_from_li_pattern_set ( const std :: vector < LearnItPattern_ptr > & pattern_set , ElfRelationMultisetSortedByName & output_relations ) { bool verbose = ParamReader :: getOptionalTrueFalseParamWithDefaultVal ( " " , false ) ; std :: set < std :: wstring > rel_names ; BOOST_FOREACH ( LearnItPattern_ptr pattern , pattern_set ) { if ( verbose ) { SessionLogger :: info ( " " ) << pattern -> getTarget ( ) -> getName ( ) << endl ; } std :: wstring rel_name = pattern -> getTarget ( ) -> getELFOntologyType ( ) ; std :: vector < ElfRelationArg_ptr > arg_vec ; if ( rel_names . find ( rel_name ) == rel_names . end ( ) ) { fake_args_from_li_pattern ( pattern , arg_vec ) ; add_relation_from_arg_vec ( arg_vec , pattern -> getTarget ( ) -> getELFOntologyType ( ) , pattern -> getTarget ( ) -> getName ( ) , output_relations ) ; } else { SessionLogger :: info ( " " ) << " " << rel_name << " \n " ; } } }
RELATIONS FROM LEARNIT PATTERNS
 Static factory method that builds an ElfRelation_ptr multiset (with the relation name as the key)
 from a set of Pattern pointers found using LearnIt patterns.
RELATIONS FROM LEARNIT PATTERNS Static factory method that builds an ElfRelation_ptr multiset ( with the relation name as the key ) from a set of Pattern pointers found using LearnIt patterns .
/* defaultVal=*/