<commit_before><%= "#{@plan.title}" %>
<%= "----------------------------------------------------------\n" %>
<% if @show_coversheet %>
<%= @hash[:attribution].length > 1 ? _("Creators: ") : _('Creator:') %> <%= @hash[:attribution].join(', ') %>
<%= _("Affiliation: ") + @hash[:affiliation] %>
  <% if @hash[:funder].present? %>
<%= _("Template: ") + @hash[:funder] %>
  <% else %>
<%= _("Template: ") + @hash[:template] + @hash[:customizer] %>
  <% end %>
  <% if @plan.grant_number.present? %>
<%= _("Grant number: ") + @plan.grant_number %>
  <% end %>
  <% if @plan.description.present? %>
<%= _("Project abstract: ") %>
<%= "\t" + strip_tags(@plan.description) + "\n" %>
  <% end %>
<%= _("Last modified: ") + l(@plan.updated_at.to_date, formats: :short) %>
<%= _("Copyright information:") %>
<%= "\t" + _(" The above plan creator(s) have agreed that others may use as much of the text of this plan as they would like in their own plans, and customise it as necessary. You do not need to credit the creator(s) as the source of the language used, but using any of the plan's text does not imply that the creator(s) endorse, or have any relationship to, your project or proposal") %>
<%= "----------------------------------------------------------\n" %>
<% end %>

<% @hash[:phases].each do |phase| %>
<%= (@hash[:phases].length > 1 ? "#{phase[:title]}" : "") %>
  <% phase[:sections].each do |section| %>
    <% if @show_sections_questions %>
<%= "#{section[:title]}\n" %>
    <% end %>
    <% section[:questions].each do |question| %>
      <% if @show_sections_questions %>
        <%# text in this case is an array to accomodate for option_based %>
        <% if question[:text].length > 1 %>
          <% question[:text].each do |txt| %>
<%= "#{strip_tags(txt.gsub(/<br\/?>/, '\n'))}\n" %>
          <% end %>
        <% else %>
<%= "#{strip_tags(question[:text][0].gsub(/<tr>(\s|<td>|<\/td>|&nbsp;)*(<\/tr>|<tr>)/,""))}\n" if question[:text].present? && question[:text][0].present? %>
        <% end %>
      <% end %>
      <% answer = @plan.answer(question[:id], false) %>
      <% blank = (answer.present? && answer.is_valid?) ? answer.text.gsub(/<\/?p>/, '').gsub(/<br\s?\/?>/, '\n').chomp.blank? : true %>
      <% if blank && @show_unanswered %>
<%= "    #{_("Question not answered.")}\n\n" %>
      <% elsif !blank %>
        <% if answer.question_options.length > 0 %>
          <% answer.question_options.each do |opt| %>
<%= "    #{opt.text}\n" %>
          <% end %>
        <% else %>
<%= "    #{strip_tags(answer.text.gsub(/<\/?p>/, '').gsub(/<br\s?\/?>/, '\n').chomp)}\n\n" if answer.text.present? %>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

<%= "----------------------------------------------------------" %>
<%= _("A Data Management Plan created using %{application_name}") % { application_name: Rails.configuration.branding[:application][:name] } %><commit_msg>fixed issue with text downloads<commit_after><%= "#{@plan.title}" %>
<%= "----------------------------------------------------------\n" %>
<% if @show_coversheet %>
<%= @hash[:attribution].length > 1 ? _("Creators: ") : _('Creator:') %> <%= @hash[:attribution].join(', ') %>
<%= _("Affiliation: ") + @hash[:affiliation] %>
  <% if @hash[:funder].present? %>
<%= _("Template: ") + @hash[:funder] %>
  <% else %>
<%= _("Template: ") + @hash[:template] + @hash[:customizer] %>
  <% end %>
  <% if @plan.grant_number.present? %>
<%= _("Grant number: ") + @plan.grant_number %>
  <% end %>
  <% if @plan.description.present? %>
<%= _("Project abstract: ") %>
<%= "\t" + strip_tags(@plan.description) + "\n" %>
  <% end %>
<%= _("Last modified: ") + l(@plan.updated_at.to_date, formats: :short) %>
<%= _("Copyright information:") %>
<%= "\t" + _(" The above plan creator(s) have agreed that others may use as much of the text of this plan as they would like in their own plans, and customise it as necessary. You do not need to credit the creator(s) as the source of the language used, but using any of the plan's text does not imply that the creator(s) endorse, or have any relationship to, your project or proposal") %>
<%= "----------------------------------------------------------\n" %>
<% end %>

<% @hash[:phases].each do |phase| %>
<%= (@hash[:phases].length > 1 ? "#{phase[:title]}" : "") %>
  <% phase[:sections].each do |section| %>
    <% if @show_sections_questions %>
<%= "#{section[:title]}\n" %>
    <% end %>
    <% section[:questions].each do |question| %>
      <% if @show_sections_questions %>
        <%# text in this case is an array to accomodate for option_based %>
        <% if question[:text].respond_to?(:each) %>
          <% question[:text].each do |txt| %>
<%= "#{strip_tags(txt.gsub(/<br\/?>/, '\n'))}\n" %>
          <% end %>
        <% else %>
<%= "#{strip_tags(question[:text][0].gsub(/<tr>(\s|<td>|<\/td>|&nbsp;)*(<\/tr>|<tr>)/,""))}\n" if question[:text].present? && question[:text][0].present? %>
        <% end %>
      <% end %>
      <% answer = @plan.answer(question[:id], false) %>
      <% blank = (answer.present? && answer.is_valid?) ? answer.text.gsub(/<\/?p>/, '').gsub(/<br\s?\/?>/, '\n').chomp.blank? : true %>
      <% if blank && @show_unanswered %>
<%= "    #{_("Question not answered.")}\n\n" %>
      <% elsif !blank %>
        <% if answer.question_options.length > 0 %>
          <% answer.question_options.each do |opt| %>
<%= "    #{opt.text}\n" %>
          <% end %>
        <% end %>
<%= "    #{strip_tags(answer.text.gsub(/<\/?p>/, '').gsub(/<br\s?\/?>/, '\n').chomp)}\n\n" if answer.text.present? %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

<%= "----------------------------------------------------------" %>
<%= _("A Data Management Plan created using %{application_name}") % { application_name: Rails.configuration.branding[:application][:name] } %>
{'fraction_non_alphanumeric': 0.30090768967288917, 'fraction_numerical': 0.001883884226751156, 'mean_word_length': 2.6363636363636362, 'pattern_counts': {'":': 0, '<': 138, '<?xml version=': 0, '>': 145, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6067605', 'n_tokens_mistral': 2125, 'n_tokens_neox': 1855, 'n_words': 412}