<commit_before>// Parse test application
// Based upon: parsetest.cpp from xmlpp

// needed includes
#include <fstream>
#include <iostream>
//#include <ctime>
#include <cppdom/cppdom.h>

#include <testHelpers.h>


// namespace includes
using namespace cppdom;
using namespace std;


void process_xml( std::string filename )
{
   cout << "processing [" << filename << "] ..." << endl;

   ContextPtr context( new Context );
   Document node( context );
   ifstream istr( filename.c_str() );

   // Verify that file opened
   if(!istr)
   {
      std::cerr << "Bad file: " << filename << std::endl;
      return;
   }

   try
   {
//      clock_t tstart = ::clock();

      node.load( istr, context );

//      clock_t tstop = ::clock();
//      cout << " needed " <<
//         (tstop-tstart)/static_cast<float>(CLOCKS_PER_SEC)
//         << " seconds." << endl;

      testHelpers::dump_node( node );

      ofstream ostr( "parsetest.xml" );
      node.save( ostr );
      ostr.close();

   }
   catch (Error e)
   {
      Location where( context->getLocation() );
      std::string errmsg;
      e.getStrError(errmsg);<commit_msg>Fix up the test build that someone broke a couple of days ago.<commit_after>// Parse test application
// Based upon: parsetest.cpp from xmlpp

// needed includes
#include <fstream>
#include <iostream>
//#include <ctime>
#include <cppdom/cppdom.h>

#include <testHelpers.h>


// namespace includes
using namespace cppdom;
using namespace std;


void process_xml( std::string filename )
{
   cout << "processing [" << filename << "] ..." << endl;

   ContextPtr context( new Context );
   Document node( context );
   ifstream istr( filename.c_str() );

   // Verify that file opened
   if(!istr)
   {
      std::cerr << "Bad file: " << filename << std::endl;
      return;
   }

   try
   {
//      clock_t tstart = ::clock();

      node.load( istr, context );

//      clock_t tstop = ::clock();
//      cout << " needed " <<
//         (tstop-tstart)/static_cast<float>(CLOCKS_PER_SEC)
//         << " seconds." << endl;

      testHelpers::dump_node( node );

      ofstream ostr( "parsetest.xml" );
      node.save( ostr );
      ostr.close();

   }
   catch (Error e)
   {
      Location where( context->getLocation() );
      std::string errmsg = e.getStrError();
{'fraction_non_alphanumeric': 0.15608695652173912, 'fraction_numerical': 0.0, 'mean_word_length': 2.5897035881435255, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1956509', 'n_tokens_mistral': 754, 'n_tokens_neox': 739, 'n_words': 191}