src/Generic/SPropTrees/SForestUtilities.cpp
//extract all proposition trees stored in a file

extract all proposition trees stored in a file
extract all proposition trees stored in a file
size_t SForestUtilities::resurectPropForest(const std::string& filename, const DocTheory* dt, SPropForest& forest, SNodeContent::Language lang) {
	boost::scoped_ptr<UTF8InputStream> uis_scoped_ptr(UTF8InputStream::build());
	UTF8InputStream& uis(*uis_scoped_ptr);
	try {
		uis.open(filename.c_str());
	} catch ( UnrecoverableException &e ) { e.getMessage(); }
	if ( ! uis.fail() ) {
		SPropTreeInfo ptin;
		while ( !uis.eof() && SPropTreeInfo::resurect(uis, dt, ptin) ) {
			if ( ptin.tree ) ptin.tree->setLanguage(lang);
			forest.insert(ptin);
		}
	}
	return forest.size();
}
size_t SForestUtilities :: resurectPropForest ( const std :: string & filename , const DocTheory * dt , SPropForest & forest , SNodeContent :: Language lang ) { boost :: scoped_ptr < UTF8InputStream > uis_scoped_ptr ( UTF8InputStream :: build ( ) ) ; UTF8InputStream & uis ( * uis_scoped_ptr ) ; try { uis . open ( filename . c_str ( ) ) ; } catch ( UnrecoverableException & e ) { e . getMessage ( ) ; } if ( ! uis . fail ( ) ) { SPropTreeInfo ptin ; while ( ! uis . eof ( ) && SPropTreeInfo :: resurect ( uis , dt , ptin ) ) { if ( ptin . tree ) ptin . tree -> setLanguage ( lang ) ; forest . insert ( ptin ) ; } } return forest . size ( ) ; }
extract all proposition trees stored in a file
extract all proposition trees stored in a file
///* wcerr << "*** resurrected: \n";
 //ptin.tree->serialize(std::wcerr,ptin.sentNumber);
 //for ( PhrasesInTree::const_iterator pitci=ptin.allWords.begin(); pitci != ptin.allWords.end(); pitci++ )
 //std::wcerr << pitci->first << " => " << pitci->second;
 //std::cerr << "\n"; */
