src/PredFinder/inference/EIUtils.cpp
/** 
 *  Create a binary ElfRelation & two new individuals.
 **/
Create a binary ElfRelation & two new individuals.
Create a binary ElfRelation & two new individuals .
ElfRelation_ptr EIUtils::createBinaryRelation(EIDocData_ptr docData,
	   const std::wstring & relation_name, EDTOffset start_offset, EDTOffset end_offset, 
	   const std::wstring & role1, const std::wstring & type1, const Mention *arg1, 
	   const std::wstring & role2, const std::wstring & type2, const Mention *arg2,
	   double confidence)
{
	std::vector<ElfRelationArg_ptr> arguments = createRelationArgFromMention(docData, role1, type1, arg1);
	std::vector<ElfRelationArg_ptr> args2 =  createRelationArgFromMention(docData, role2, type2, arg2);
	arguments.insert(arguments.end(), args2.begin(), args2.end());
	LocatedString* relationTextLS = MainUtilities::substringFromEdtOffsets(
		docData->getDocument()->getOriginalText(), start_offset, end_offset);
	std::wstring relation_text = relationTextLS->toString();
	delete relationTextLS;
	return boost::make_shared<ElfRelation>(relation_name, arguments, relation_text, start_offset, end_offset, confidence, Pattern::UNSPECIFIED_SCORE_GROUP);
}
ElfRelation_ptr EIUtils :: createBinaryRelation ( EIDocData_ptr docData , const std :: wstring & relation_name , EDTOffset start_offset , EDTOffset end_offset , const std :: wstring & role1 , const std :: wstring & type1 , const Mention * arg1 , const std :: wstring & role2 , const std :: wstring & type2 , const Mention * arg2 , double confidence ) { std :: vector < ElfRelationArg_ptr > arguments = createRelationArgFromMention ( docData , role1 , type1 , arg1 ) ; std :: vector < ElfRelationArg_ptr > args2 = createRelationArgFromMention ( docData , role2 , type2 , arg2 ) ; arguments . insert ( arguments . end ( ) , args2 . begin ( ) , args2 . end ( ) ) ; LocatedString * relationTextLS = MainUtilities :: substringFromEdtOffsets ( docData -> getDocument ( ) -> getOriginalText ( ) , start_offset , end_offset ) ; std :: wstring relation_text = relationTextLS -> toString ( ) ; delete relationTextLS ; return boost :: make_shared < ElfRelation > ( relation_name , arguments , relation_text , start_offset , end_offset , confidence , Pattern :: UNSPECIFIED_SCORE_GROUP ) ; }
Create a binary ElfRelation & two new individuals.
Create a binary ElfRelation & two new individuals .