<commit_before>module Shrinker
  module Parser
    class Url < Abstract
      def replace
        return url.to_s if url.params.delete(:shrinker).to_s == 'false'
        return url.to_s if url =~ excluded_path_regex

        new_url = url.to_s
        new_url = shrink if url =~ url_regex

        new_url
      end

      def shrink
        token = Token.generate
        backend.store(content, token, attributes)
        [shrinked_pattern, token].join("/")
      end

      def url
        @url ||= EasyUrl.new(content)
      end
    end
  end
end<commit_msg>Always use base_url_regex for url parser.<commit_after>module Shrinker
  module Parser
    class Url < Abstract
      def replace
        return url.to_s if url.params.delete(:shrinker).to_s == 'false'
        return url.to_s if url =~ excluded_path_regex

        new_url = url.to_s
        new_url = shrink if url =~ url_regex

        new_url
      end

      def shrink
        token = Token.generate
        backend.store(content, token, attributes)
        [shrinked_pattern, token].join("/")
      end

      def url
        @url ||= EasyUrl.new(content)
      end

      def url_regex
        base_url_regex
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07724252491694353, 'fraction_numerical': 0.0, 'mean_word_length': 1.9534313725490196, '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': '4907868', 'n_tokens_mistral': 390, 'n_tokens_neox': 367, 'n_words': 100}