<commit_before><?php
function isIsogram($in){
    $in = strtolower($in);
    $in = preg_replace("/-/","",$in);
    $in = preg_replace("/\s/","",$in);

    $spec = preg_split("/\w+/", $in);
    $spec = array_filter($spec,function ($s) {return $s !== "";});

    $in = preg_replace("/\W/","",$in);
    $chars =  str_split($in);

    return !(sizeof($spec) !== sizeof(array_unique($spec)))&&
    !(sizeof($chars) !== sizeof(array_unique($chars)));
}<commit_msg>Problem 8: refactor solved<commit_after><?php
function isIsogram($in)
{
    $in = strtolower($in);
    $in = preg_replace("/-/", "", $in);
    $in = preg_replace("/\s/", "", $in);

    $spec = preg_split("/\w+/", $in);
    $spec = array_filter($spec, function ($s) {
        return $s !== "";
    });

    $in = preg_replace("/\W/", "", $in);
    $chars = str_split($in);

    return !(sizeof($spec) !== sizeof(array_unique($spec))) &&
        !(sizeof($chars) !== sizeof(array_unique($chars)));
}
{'fraction_non_alphanumeric': 0.2732984293193717, 'fraction_numerical': 0.0010471204188481676, 'mean_word_length': 3.5961538461538463, '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': '5694504', 'n_tokens_mistral': 349, 'n_tokens_neox': 339, 'n_words': 59}