<commit_before><?

$file = fopen($argv[1], 'r');

$msgid  = false;
$msgstr = false;

while( ($line = fgets($file)) ) {
 
    if(preg_match('/msgid\s"(.*)"/U', $line, $matches)) {
        $msgid = '"'.$matches[1].'"';
        
    } else if(preg_match('/msgstr\s"(.*)"/U', $line, $matches)) {
        $msgstr = '"'.$matches[1].'"';
        
        if($msgstr != '""' && $msgid != '""') { 
            echo $msgid.';'.$msgstr."\n";
        } else {
            $msgid = false;
        }
    }
}



<commit_msg>Write csv line even if msgstr is empty<commit_after><?

$file = fopen($argv[1], 'r');

$msgid  = false;
$msgstr = false;

while( ($line = fgets($file)) ) {
 
    if(preg_match('/msgid\s"(.*)"/U', $line, $matches)) {
        $msgid = '"'.$matches[1].'"';
        
    } else if(preg_match('/msgstr\s"(.*)"/U', $line, $matches)) {
        $msgstr = '"'.$matches[1].'"';
        
        if($msgid != '""') { 
            echo $msgid.';'.$msgstr."\n";
        } else {
            $msgid = false;
        }
    }
}




{'fraction_non_alphanumeric': 0.2646484375, 'fraction_numerical': 0.005859375, 'mean_word_length': 1.9454022988505748, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6380041', 'n_tokens_mistral': 412, 'n_tokens_neox': 378, 'n_words': 64}