src/PredFinder/inference/EIUtils.cpp
// These are exceptions as in "exceptions to the rule", not thrown exceptions.

These are exceptions as in "exceptions to the rule", not thrown exceptions.
These are exceptions as in " exceptions to the rule " not thrown exceptions .
void EIUtils::initAllowedDoubleEntityRelations() {
	static bool init = false;
	if (!init) {
		std::string exception_file = 
			ParamReader::getParam("allowed_double_entity_relations");
		if (exception_file != string()) {
			boost::scoped_ptr<UTF8InputStream> exceptionStream_scoped_ptr(UTF8InputStream::build(exception_file.c_str()));
			UTF8InputStream& exceptionStream(*exceptionStream_scoped_ptr);
			std::wstring line;
			while (getline(exceptionStream, line)) {
				std::vector<std::wstring> parts;
				boost::split(parts, line, boost::is_any_of("\t "));
				if (parts.size() == 3) {
					_allowedDoubleEntityRelations.insert(
						boost::make_tuple(parts[0], parts[1], parts[2]));
					_allowedDoubleEntityRelations.insert(
						boost::make_tuple(parts[0], parts[2], parts[1]));
				} else if (line.length() > 0)  {
					SessionLogger::warn("LEARNIT") << "ignoring ill-formed line in " <<
						"double entity relations exceptions file : " <<
						std::endl << line << std::endl;
				}
			}
			exceptionStream.close();
		} else {
			SessionLogger::warn("no_doub_ent_0") << "using no exceptions to double entity filter\n";
		}
	}
}
void EIUtils :: initAllowedDoubleEntityRelations ( ) { static bool init = false ; if ( ! init ) { std :: string exception_file = ParamReader :: getParam ( " " ) ; if ( exception_file != string ( ) ) { boost :: scoped_ptr < UTF8InputStream > exceptionStream_scoped_ptr ( UTF8InputStream :: build ( exception_file . c_str ( ) ) ) ; UTF8InputStream & exceptionStream ( * exceptionStream_scoped_ptr ) ; std :: wstring line ; while ( getline ( exceptionStream , line ) ) { std :: vector < std :: wstring > parts ; boost :: split ( parts , line , boost :: is_any_of ( " \t " ) ) ; if ( parts . size ( ) == 3 ) { _allowedDoubleEntityRelations . insert ( boost :: make_tuple ( parts [ 0 ] , parts [ 1 ] , parts [ 2 ] ) ) ; _allowedDoubleEntityRelations . insert ( boost :: make_tuple ( parts [ 0 ] , parts [ 2 ] , parts [ 1 ] ) ) ; } else if ( line . length ( ) > 0 ) { SessionLogger :: warn ( " " ) << " " << " " << std :: endl << line << std :: endl ; } } exceptionStream . close ( ) ; } else { SessionLogger :: warn ( " " ) << " \n " ; } } }
These are exceptions as in "exceptions to the rule", not thrown exceptions.
These are exceptions as in " exceptions to the rule " not thrown exceptions .