<commit_before>Panopticon::Application.routes.draw do
  # This is necessary to support some whitehall artefacts with a locale extension on the end
  # of the slug.  If we just blanket allow . in the slug, this interferes with the formatted
  # routes, so this instead special cases the 3 variants of locale extensions (.fr, .zh-hk, .es-419)
  artefact_id_regex = %r{
    [^\.]+                # 1 or more non-dot characters
    (\.[a-z]{2}           # optionally dot followed by a basic locale (eg 'fr')
      (                     # optionally followed by a locale extension
        -[a-z]{2} |           # eg zh-hk
        -\d{3}                # eg es-419
      )?
    )?
  }x
  resources :artefacts, :constraints => { :id => artefact_id_regex } do
    member do
      get :history
      get :archive
    end
    collection do
      get :search_relatable_items, constraints: { format: :json }
    end
  end
  
  resources :tags do
    member do
      put :publish
    end
  end

  root :to => redirect("/artefacts")
end
<commit_msg>Include admin template style guide<commit_after>Panopticon::Application.routes.draw do
  # This is necessary to support some whitehall artefacts with a locale extension on the end
  # of the slug.  If we just blanket allow . in the slug, this interferes with the formatted
  # routes, so this instead special cases the 3 variants of locale extensions (.fr, .zh-hk, .es-419)
  artefact_id_regex = %r{
    [^\.]+                # 1 or more non-dot characters
    (\.[a-z]{2}           # optionally dot followed by a basic locale (eg 'fr')
      (                     # optionally followed by a locale extension
        -[a-z]{2} |           # eg zh-hk
        -\d{3}                # eg es-419
      )?
    )?
  }x
  resources :artefacts, :constraints => { :id => artefact_id_regex } do
    member do
      get :history
      get :archive
    end
    collection do
      get :search_relatable_items, constraints: { format: :json }
    end
  end

  resources :tags do
    member do
      put :publish
    end
  end

  root :to => redirect("/artefacts")

  mount GovukAdminTemplate::Engine, at: "/style-guide"
end

{'fraction_non_alphanumeric': 0.0951048951048951, 'fraction_numerical': 0.010256410256410256, 'mean_word_length': 2.101156069364162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1018414', 'n_tokens_mistral': 674, 'n_tokens_neox': 627, 'n_words': 234}