<commit_before>var HASHTAG_PATTERN = /(^|\s)#([a-zA-Z\u0400-\u04FF\d\-_]+)/ig,
    URL_PATTERN = /(^|\s)(https?:\/\/)?([\da-z\.\-]+)\.([a-z\.]{2,6})([\/\w \.\-]*)*\/?($|\s)/ig,
    IMG_PATTERN = /(^|\s)(https?:\/\/)?([\da-z\.\-]+)\.([a-z\.]{2,6})([\/\w \.\-]*)\.(jpe?g|png|gif)($|\s)/i,
    moment = require('moment'),
    escape = require('escape-html');

module.exports = function() {
    var getMessageWithHashtags = function(content) {
            var anchor = '$1<a href="/search?query=$2">#$2</a>';
            return content.replace(HASHTAG_PATTERN, anchor);
        },

        getMessageWithUrls = function(content) {
            var anchor = '<a target="_blank" href="$2$3.$4$5">$1$3.$4$5</a>';
            return content.replace(URL_PATTERN, anchor);
        },

        getMessageWithImg = function(content) {
            var anchor = '<img class="tvit-pic" src="$2$3.$4$5.$6">';
            return content.replace(IMG_PATTERN, anchor);
        },

        getTimeInterval = function(datePublished) {
            var interval = moment().diff(moment(datePublished), 'years');
            var period = interval === 1 ? 'година' : 'години';
            if (interval > 0) {
                return 'преди ' + interval + ' ' + period;
            }

            interval = moment().diff(moment(datePublished), 'months');
            period = interval === 1 ? 'месец' : 'месеца';
            if (interval > 0) {<commit_msg>updated url and img regex patterns<commit_after>var HASHTAG_PATTERN = /(^|\s)#([a-zA-Z\u0400-\u04FF\d\-_]+)/ig,
    URL_PATTERN = /(^|\s)(https?:\/\/)(([\w\-]+\.)+)([a-z]{2,63})([\/][\S]*)?\/?($|\s)/ig,
    IMG_PATTERN = /(^|\s)(https?:\/\/)(([\w\-]+\.)+)([a-z]{2,63})([\/][\S]*)\.(jpe?g|png|gif)($|\s)/i,
    moment = require('moment'),
    escape = require('escape-html');

module.exports = function() {
    var getMessageWithHashtags = function(content) {
            var anchor = '$1<a href="/search?query=$2">#$2</a>';
            return content.replace(HASHTAG_PATTERN, anchor);
        },

        getMessageWithUrls = function(content) {
            var anchor = '<a target="_blank" href="$2$3$5$6">$1$3$5$6$7</a>';
            return content.replace(URL_PATTERN, anchor);
        },

        getMessageWithImg = function(content) {
            var anchor = '<img class="tvit-pic" src="$2$3$5$6.$7">';
            return content.replace(IMG_PATTERN, anchor);
        },

        getTimeInterval = function(datePublished) {
            var interval = moment().diff(moment(datePublished), 'years');
            var period = interval === 1 ? 'година' : 'години';
            if (interval > 0) {
                return 'преди ' + interval + ' ' + period;
            }

            interval = moment().diff(moment(datePublished), 'months');
            period = interval === 1 ? 'месец' : 'месеца';
            if (interval > 0) {
{'fraction_non_alphanumeric': 0.22990915443745633, 'fraction_numerical': 0.0220125786163522, 'mean_word_length': 2.294591484464902, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '2320945', 'n_tokens_mistral': 1034, 'n_tokens_neox': 988, 'n_words': 153}