<commit_before><?php

namespace Mihaeu\SubCollector\Subtitle;

class Cleaner
{
    public function cleanUpFile($fileName)
    {
        $data = file_get_contents($fileName);

        try {
            $arr = SrtParser::parse($data);
            $arr = self::cleanupCaptions($arr);
            $outData = SrtWriter::render($arr);<commit_msg>Subtitle\Cleaner: backup orginal file before writing parsed file over it<commit_after><?php

namespace Mihaeu\SubCollector\Subtitle;

class Cleaner
{
    public function cleanUpFile($fileName)
    {
        $data = file_get_contents($fileName);

        try {
            $arr = SrtParser::parse($data);
            $arr = self::cleanupCaptions($arr);
            $outData = SrtWriter::render($arr);
            rename($fileName, $fileName.'.org');
{'fraction_non_alphanumeric': 0.12690355329949238, 'fraction_numerical': 0.0, 'mean_word_length': 2.8866995073891624, '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': '6505959', 'n_tokens_mistral': 231, 'n_tokens_neox': 236, 'n_words': 44}