<commit_before># frozen_string_literal: true

module Folio
  module CstypoHelper
    CSTYPO_REGEXP = /(?<![<\/])\b([szkvaiou%]\b) /i

    def cstypo(string)
      if I18n.locale == :cs
        string.gsub(CSTYPO_REGEXP, '\1&nbsp;')
              .gsub(/(\d+)\s+(\d+)/, '\1&nbsp;\2')
              .gsub(/(\d+)\s+(Kč)/, '\1&nbsp;\2')
              .html_safe
      else
        string
      end
    end
  end
end<commit_msg>handle nil in cstypo helper<commit_after># frozen_string_literal: true

module Folio::CstypoHelper
  CSTYPO_REGEXP = /(?<![<\/])\b([szkvaiou%]\b) /i

  def cstypo(string)
    if string.present? && I18n.locale == :cs
      string.gsub(CSTYPO_REGEXP, '\1&nbsp;')
            .gsub(/(\d+)\s+(\d+)/, '\1&nbsp;\2')
            .gsub(/(\d+)\s+(Kč)/, '\1&nbsp;\2')
            .html_safe
    else
      string
    end
  end
end
{'fraction_non_alphanumeric': 0.2040332147093713, 'fraction_numerical': 0.0166073546856465, 'mean_word_length': 2.069090909090909, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2956854', 'n_tokens_mistral': 356, 'n_tokens_neox': 349, 'n_words': 57}