<commit_before><?php
//    $host = "localhost";
//    $user_name = "root";
//    $password = "";
//    $database_name = "vawhack";
//    $db = mysql_connect($host, $user_name, $password);
//    if (mysql_error() > ""){ 
//        print_r(mysql_error());
//    }
//    mysql_select_db($database_name, $db);

    require_once('../source_functions.php');
    
    // $directory = "nfsshare/audiofiles/" //directory from where to read file
    $directory = realpath("/nfsshare/audiofiles");
    var_dump($directory);
    // get all text files with a .txt extension.
    $texts = glob($directory . "*.txt");
    
    if(empty($texts)){
        echo "File not present";
        return;
    }
    foreach($texts as $filename){
        $my_array = array();
        $my_array['filename'] = basename($filename, ".txt"); 
        $file = fopen($filename, 'r');
        while(!feof($file)){
            $current_line = trim(fgets($file));
            $each_line = explode("=", $current_line);
            if($each_line[0] == "callerid"){
                $reg = '/<([0-9]+)>$/';
                $matches = array();
                preg_match($reg, $each_line[1], $matches);
                $my_array['caller_id'] = $matches[1];
            }
            elseif($each_line[0] == "origtime"){
                $my_array['origtime'] = $each_line[1];
            }
        }
        fclose($file);
//        $query = "INSERT INTO vmf(afn, callerid, calltime) values ('".$my_array['filename']."','".$my_array['caller_id']."','".$my_array['origtime']."')";
//        print_r($query);
//        $qresult = mysql_query($query);
//        print_r($my_array);
        $save_res = saveVmf($my_array['filename'], $my_array['caller_id'], $my_array['origtime']);
        var_dump($save_res);
    }
    

?>
<commit_msg>files lists fixed<commit_after><?php
//    $host = "localhost";
//    $user_name = "root";
//    $password = "";
//    $database_name = "vawhack";
//    $db = mysql_connect($host, $user_name, $password);
//    if (mysql_error() > ""){ 
//        print_r(mysql_error());
//    }
//    mysql_select_db($database_name, $db);

    require_once('../source_functions.php');
    
    // $directory = "nfsshare/audiofiles/" //directory from where to read file
    $directory = realpath("/nfsshare/audiofiles");

    // get all text files with a .txt extension.
    
    $texts = glob($directory . "/*.txt");
    var_dump($texts);
    if(empty($texts)){
        echo "File not present";
        return;
    }
    foreach($texts as $filename){
        $my_array = array();
        $my_array['filename'] = basename($filename, ".txt"); 
        $file = fopen($filename, 'r');
        while(!feof($file)){
            $current_line = trim(fgets($file));
            $each_line = explode("=", $current_line);
            if($each_line[0] == "callerid"){
                $reg = '/<([0-9]+)>$/';
                $matches = array();
                preg_match($reg, $each_line[1], $matches);
                $my_array['caller_id'] = $matches[1];
            }
            elseif($each_line[0] == "origtime"){
                $my_array['origtime'] = $each_line[1];
            }
        }
        fclose($file);
//        $query = "INSERT INTO vmf(afn, callerid, calltime) values ('".$my_array['filename']."','".$my_array['caller_id']."','".$my_array['origtime']."')";
//        print_r($query);
//        $qresult = mysql_query($query);
//        print_r($my_array);
        $save_res = saveVmf($my_array['filename'], $my_array['caller_id'], $my_array['origtime']);
        var_dump($save_res);
    }
    

?>

{'fraction_non_alphanumeric': 0.20340401785714285, 'fraction_numerical': 0.00390625, 'mean_word_length': 2.2561307901907357, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2824529', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1178, 'n_words': 194}