<commit_before># coding: utf-8

require 'spec_helper'

I18nInteraction = Class.new(TestInteraction) do
  hash :a do
    hash :x
  end
end

describe I18nInteraction do
  include_context 'interactions'

  TYPES = %w[
    array
    boolean
    date
    date_time
    file
    float
    hash
    integer
    model
    string
    time
  ]
<commit_msg>Don't hard code the list of types<commit_after># coding: utf-8

require 'spec_helper'

I18nInteraction = Class.new(TestInteraction) do
  hash :a do
    hash :x
  end
end

describe I18nInteraction do
  include_context 'interactions'

  pattern = ActiveInteraction::Filter.const_get(:CLASS_REGEXP)
  TYPES = ActiveInteraction::Filter
    .const_get(:CLASSES)
    .select { |_, filter| filter.name =~ pattern }
    .reject { |_, filter| filter.name =~ /\bAbstract[A-Z]/ }
    .map { |slug, _| slug.to_s }

{'fraction_non_alphanumeric': 0.09669811320754718, 'fraction_numerical': 0.01179245283018868, 'mean_word_length': 3.1414634146341465, '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': '654243', 'n_tokens_mistral': 309, 'n_tokens_neox': 298, 'n_words': 75}