<commit_before>"use strict";
const csv = require("fast-csv");
const mkdirp = require("mkdirp-promise");
const readdir = require("fs-readdir-promise");

const write = require("fs-writefile-promise/lib/node6");

module.exports.createFolder = (folderName) => {
    mkdirp(folderName)
        .catch(console.error);
};

module.exports.saveFile = (filePath, content) => {
    return write(filePath, content)
        .then((filename) => {
            console.log(filename);
        })
        .catch((err) => {
            console.error(err);
        });
};

module.exports.cleanupStringFloat = (text) => {
    return parseFloat(text.replace("%", "").replace(/,/g, ""));<commit_msg>Improve string cleaning<commit_after>"use strict";
const csv = require("fast-csv");
const mkdirp = require("mkdirp-promise");
const readdir = require("fs-readdir-promise");

const write = require("fs-writefile-promise/lib/node6");

module.exports.createFolder = (folderName) => {
    mkdirp(folderName)
        .catch(console.error);
};

module.exports.saveFile = (filePath, content) => {
    return write(filePath, content)
        .then((filename) => {
            console.log(filename);
        })
        .catch((err) => {
            console.error(err);
        });
};

module.exports.cleanupStringFloat = (text) => {
    return parseFloat(
        text
            .replace("EUR", "")
            .replace(/[%$,]/g,"")
    );
{'fraction_non_alphanumeric': 0.17981520966595593, 'fraction_numerical': 0.0014214641080312722, 'mean_word_length': 2.9329608938547485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '6824786', 'n_tokens_mistral': 443, 'n_tokens_neox': 433, 'n_words': 70}