<commit_before>module Titleable
  extend ActiveSupport::Concern

  included do
    validates :canonical_title, presence: true
    validate :has_english_title
  end

  def canonical_title
    titles[self[:canonical_title]]
  end

  private

  def has_english_title?
    titles.keys.any? { |k| k.end_with?('_en') }
  end

  def has_english_title
    unless has_english_title?<commit_msg>server: begin fixing ja_en to en_jp in titleable<commit_after>module Titleable
  extend ActiveSupport::Concern

  included do
    validates :canonical_title, presence: true
    validate :has_english_title
  end

  def canonical_title
    titles[self[:canonical_title]]
  end

  private

  def has_english_title?
    titles.keys.any? { |k| k.end_with?('_en') || k.start_with('en_') }
  end

  def has_english_title
    unless has_english_title?
{'fraction_non_alphanumeric': 0.07971014492753623, 'fraction_numerical': 0.0, 'mean_word_length': 4.149068322981367, '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': '4655435', 'n_tokens_mistral': 291, 'n_tokens_neox': 277, 'n_words': 63}