<commit_before><?php

namespace App\Http\Controllers;

use Carbon\Carbon;

class CitcuitController {

    private function parseNumber($n, $startfrom = 10000) {
        if (!is_null($n) || $n != '') {
            if ($n < $startfrom) {
                $n_format = number_format($n);
            } else if ($n < 1000000) {
                $n_format = number_format($n / 1000, 1) . 'K';
            } else if ($n < 1000000000) {
                $n_format = number_format($n / 1000000, 1) . 'M';
            }

            return $n_format;
        } else {
            return $n;
        }
    }

    private function parseLinkHttp($text) {
        return preg_replace('/(^|\s)(https?:\/\/[\da-z\.-]+\.[a-z]+)(\/[^\s]*)?/i', ' <a href="$2$3" target="_blank">$2$3</a>', $text);
    }

    private function parseLinkUser($text) {
        return preg_replace('/(^|\s)@(\w{1,15})/i', ' <a href="' . url('user/$2') . '">@$2</a>', $text);
    }

    private function parseLinkEmail($text) {
        return preg_replace('/([\w\.-]+@[\da-z\.-]+\.[a-z]+)/i', ' <a href="mailto:$1">$1</a>', $text);
    }

    private function parseLinkHashtag($text) {
        return preg_replace('/(^|\s)#(\w+)/i', ' <a href="' . url('search/tweet?q=%23$2') . '">#$2</a>', $text);
    }

    public function parseProfile($profile) {
        if ($profile->description == NULL) {
            $profile->description_no_href = $profile->description;
            $profile->description = '-';
        } else {
            $profile->description_no_href = $profile->description;
            if (isset($profile->entities->description->urls) && count($profile->entities->description->urls) != 0) {
                $urls = $profile->entities->description->urls;
                foreach ($urls as $url) {
                    $profile->description_original = $profile->description;
                    $profile->description = str_replace($url->url, '<a href="' . $url->url . '" target="_blank">' . $url->display_url . '</a>', $profile->description);
                    $profile->description_no_href = str_replace($url->url, $url->display_url, $profile->description);
                }
            }

            $profile->description = $this->parseLinkEmail($profile->description);
            $profile->description = $this->parseLinkHashtag($profile->description);
            $profile->description = $this->parseLinkHttp($profile->description);
            $profile->description = $this->parseLinkUser($profile->description);
        }
        if ($profile->location == NULL) {<commit_msg>fix hastag link<commit_after><?php

namespace App\Http\Controllers;

use Carbon\Carbon;

class CitcuitController {

    private function parseNumber($n, $startfrom = 10000) {
        if (!is_null($n) || $n != '') {
            if ($n < $startfrom) {
                $n_format = number_format($n);
            } else if ($n < 1000000) {
                $n_format = number_format($n / 1000, 1) . 'K';
            } else if ($n < 1000000000) {
                $n_format = number_format($n / 1000000, 1) . 'M';
            }

            return $n_format;
        } else {
            return $n;
        }
    }

    private function parseLinkHttp($text) {
        return preg_replace('/(^|\s)(https?:\/\/[\da-z\.-]+\.[a-z]+)(\/[^\s]*)?/i', ' <a href="$2$3" target="_blank">$2$3</a>', $text);
    }

    private function parseLinkUser($text) {
        return preg_replace('/(^|\s)@(\w{1,15})/i', ' <a href="' . url('user/$2') . '">@$2</a>', $text);
    }

    private function parseLinkEmail($text) {
        return preg_replace('/([\w\.-]+@[\da-z\.-]+\.[a-z]+)/i', ' <a href="mailto:$1">$1</a>', $text);
    }

    private function parseLinkHashtag($text) {
        return preg_replace('/(^|\s)#(\w+)/i', ' <a href="' . url('search?q=%23$2') . '">#$2</a>', $text);
    }

    public function parseProfile($profile) {
        if ($profile->description == NULL) {
            $profile->description_no_href = $profile->description;
            $profile->description = '-';
        } else {
            $profile->description_no_href = $profile->description;
            if (isset($profile->entities->description->urls) && count($profile->entities->description->urls) != 0) {
                $urls = $profile->entities->description->urls;
                foreach ($urls as $url) {
                    $profile->description_original = $profile->description;
                    $profile->description = str_replace($url->url, '<a href="' . $url->url . '" target="_blank">' . $url->display_url . '</a>', $profile->description);
                    $profile->description_no_href = str_replace($url->url, $url->display_url, $profile->description);
                }
            }

            $profile->description = $this->parseLinkEmail($profile->description);
            $profile->description = $this->parseLinkHashtag($profile->description);
            $profile->description = $this->parseLinkHttp($profile->description);
            $profile->description = $this->parseLinkUser($profile->description);
        }
        if ($profile->location == NULL) {
{'fraction_non_alphanumeric': 0.2022361710474696, 'fraction_numerical': 0.02000784621420165, 'mean_word_length': 2.256066411238825, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2354965', 'n_tokens_mistral': 1635, 'n_tokens_neox': 1544, 'n_words': 258}