<commit_before>#include <iostream>
#include <fstream>
#include <string>

#include <opencv_workbench/syllo/syllo.h>

#include <opencv_workbench/rapidxml/rapidxml.hpp>
#include <opencv_workbench/rapidxml/rapidxml_utils.hpp>
#include <opencv_workbench/rapidxml/rapidxml_print.hpp>
//#include <opencv_workbench/rapidxml/rapidxml_iterators.hpp>

#include "AnnotationParser.h"

using std::cout;
using std::endl;

using namespace rapidxml;

AnnotationParser::AnnotationParser()
{
     
}

void AnnotationParser::CheckForFile(std::string video_file)
{
     video_filename_ = video_file;
     
     int lastindex = video_file.find_last_of("."); 
     xml_filename_ = video_file.substr(0, lastindex) + ".xml";
     
     dir_ = fs::path(video_file).parent_path();
     basename_ = fs::path(video_file).filename();

     if ( !boost::filesystem::exists( xml_filename_ ) ) {
          cout << "Annotation file doesn't exist. Creating..." << endl;
          std::ofstream outfile;
          outfile.open(xml_filename_.c_str());          
          outfile.close();
     } else {
          cout << "Found annotation file." << endl;
          this->ParseFile(xml_filename_);
     }
}

void AnnotationParser::write_annotation()
{
     this->write_header();
}<commit_msg>working annotation<commit_after>#include <iostream>
#include <fstream>
#include <string>

#include <opencv_workbench/syllo/syllo.h>

#include <opencv_workbench/rapidxml/rapidxml.hpp>
#include <opencv_workbench/rapidxml/rapidxml_utils.hpp>
#include <opencv_workbench/rapidxml/rapidxml_print.hpp>
//#include <opencv_workbench/rapidxml/rapidxml_iterators.hpp>

#include "AnnotationParser.h"

using std::cout;
using std::endl;

using namespace rapidxml;

AnnotationParser::AnnotationParser()
{
     
}

void AnnotationParser::CheckForFile(std::string video_file)
{
     video_filename_ = video_file;
     
     int lastindex = video_file.find_last_of("."); 
     xml_filename_ = video_file.substr(0, lastindex) + ".xml";
     
     dir_ = fs::path(video_file).parent_path();
     basename_ = fs::path(video_file).filename();

     if ( !boost::filesystem::exists( xml_filename_ ) ) {
          cout << "Annotation file doesn't exist. Creating..." << endl;
          //std::ofstream outfile;
          //outfile.open(xml_filename_.c_str());          
          //outfile.close();
     } else {
          cout << "Found annotation file." << endl;
          this->ParseFile(xml_filename_);
     }
}

void AnnotationParser::write_annotation()
{
     this->write_header();
}
{'fraction_non_alphanumeric': 0.13735609368797141, 'fraction_numerical': 0.0007939658594680428, 'mean_word_length': 3.684014869888476, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 28}, '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': '4127599', 'n_tokens_mistral': 850, 'n_tokens_neox': 831, 'n_words': 133}