<commit_before>module Middleman
  module Blog
    module Drafts
      # A module that adds draft-article-specific methods to Resources.
      # A {DraftArticle} can be retrieved via {Blog::Drafts::Helpers#current_article} or
      # methods on {Blog::Drafts::Data} (accessible through BlogData#drafts).
      # @see http://rdoc.info/github/middleman/middleman/Middleman/Sitemap/Resource Middleman::Sitemap::Resource
      module DraftArticle
        # The "slug" of the draft article that shows up in its URL.
        # @return [String]
        def slug
          @_slug ||= path_part("title")
        end

        # Retrieve a section of the source path
        # @param [String] The part of the path, e.g. "title"
        # @return [String]
        def path_part(part)
          @_path_parts ||= blog_data.drafts.source_template.extract(path)<commit_msg>Fix failure on handling the path containing non-uri chars<commit_after>module Middleman
  module Blog
    module Drafts
      # A module that adds draft-article-specific methods to Resources.
      # A {DraftArticle} can be retrieved via {Blog::Drafts::Helpers#current_article} or
      # methods on {Blog::Drafts::Data} (accessible through BlogData#drafts).
      # @see http://rdoc.info/github/middleman/middleman/Middleman/Sitemap/Resource Middleman::Sitemap::Resource
      module DraftArticle
        # The "slug" of the draft article that shows up in its URL.
        # @return [String]
        def slug
          @_slug ||= path_part("title")
        end

        # Retrieve a section of the source path
        # @param [String] The part of the path, e.g. "title"
        # @return [String]
        def path_part(part)
          normalized_path = Addressable::URI.parse(path).normalize.to_s
          @_path_parts ||= blog_data.drafts.source_template.extract(normalized_path)
{'fraction_non_alphanumeric': 0.09733550842849374, 'fraction_numerical': 0.0, 'mean_word_length': 2.8818565400843883, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6635164', 'n_tokens_mistral': 550, 'n_tokens_neox': 532, 'n_words': 157}