浏览代码

minor correction for storing and loading

janetzki 11 年之前
父节点
当前提交
fb2afbf89d
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      GPHIKClassifierNICE.cpp

+ 7 - 4
GPHIKClassifierNICE.cpp

@@ -210,7 +210,10 @@ void GPHIKClassifierNICE::restore ( std::istream & is, int format )
         b_endOfBlock = true;
         b_endOfBlock = true;
         continue;
         continue;
       } 
       } 
-      else if ( tmp.compare("classifier") == 0 )
+
+      tmp = this->removeStartTag( tmp );
+
+      if ( tmp.compare("classifier") == 0 )
       {
       {
         if ( classifier == NULL )
         if ( classifier == NULL )
           classifier = new NICE::GPHIKClassifier();
           classifier = new NICE::GPHIKClassifier();
@@ -230,7 +233,7 @@ void GPHIKClassifierNICE::restore ( std::istream & is, int format )
       }      
       }      
       else
       else
       {
       {
-      std::cerr << "WARNING -- unexpected GPHIKClassifier object -- " << tmp << " -- for restoration... aborting" << std::endl;
+      std::cerr << "WARNING -- unexpected GPHIKClassifierNICE object -- " << tmp << " -- for restoration... aborting" << std::endl;
       throw;
       throw;
       }
       }
     } // while-loop
     } // while-loop
@@ -259,7 +262,7 @@ void GPHIKClassifierNICE::store ( std::ostream & os, int format ) const
     os << this->createEndTag( "performOptimizationAfterIncrement" ) << std::endl;     
     os << this->createEndTag( "performOptimizationAfterIncrement" ) << std::endl;     
     
     
     // done
     // done
-    os << this->createEndTag( "GPHIKClassifier" ) << std::endl;        
+    os << this->createEndTag( "GPHIKClassifierNICE" ) << std::endl;
   }
   }
   else
   else
   {
   {
@@ -303,4 +306,4 @@ void GPHIKClassifierNICE::addMultipleExamples( Examples & newExamples)
   }  
   }  
   
   
   classifier->addMultipleExamples(sparseExamples, y, this->performOptimizationAfterIncrement);  
   classifier->addMultipleExamples(sparseExamples, y, this->performOptimizationAfterIncrement);  
-}
+}