<commit_before>class Filteur::Base

  # provides define_group method
  # define_group 'foo', ['Member One', 'Member Two']
  # provides: foos_hash, foos, foo_names, foo_tags
  self.extend GroupDefinition
  
  
  def self.tree
    groups.map{|g| [g, send(:"#{g.tag.pluralize}")]}
  end
    
  # TODO: change default to filter_data, or get from variable set by has_filters
  def self.to_sql(filters, field_name = "filter_text")
    to_expression(filters, 'AND', 'OR', "#{field_name} LIKE '%", "%'")
  end<commit_msg>default filter storage field name in .to_sql changed to "filter_data"<commit_after>class Filteur::Base

  # provides define_group method
  # define_group 'foo', ['Member One', 'Member Two']
  # provides: foos_hash, foos, foo_names, foo_tags
  self.extend GroupDefinition
  
  
  def self.tree
    groups.map{|g| [g, send(:"#{g.tag.pluralize}")]}
  end
    
  # TODO: change default to filter_data, or get from variable set by has_filters
  def self.to_sql(filters, field_name = "filter_data")
    to_expression(filters, 'AND', 'OR', "#{field_name} LIKE '%", "%'")
  end
{'fraction_non_alphanumeric': 0.1377079482439926, 'fraction_numerical': 0.0, 'mean_word_length': 4.334975369458128, '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': '1957855', 'n_tokens_mistral': 375, 'n_tokens_neox': 370, 'n_words': 100}