<commit_before># encoding: utf-8

require 'acts_as_solr'
require './lib/acts_as_solr_hacks/search_results.rb'

class Contribution < ActiveRecord::Base
  acts_as_solr :fields => [:solr_text, {:person_id => :facet},
                                       {:date => :facet},
                                       {:year => :facet},
                                       {:decade => :facet},
                                       {:sitting_type => :facet}],
               :facets => [:person_id, {:date => :date}, :year, :decade]
               
  self.solr_configuration  =  { :type_field => "type_t",
                                :primary_key_field => "pk_i",
                                :default_boost => 1.0 }
  
  belongs_to :person
  
  def url
    "#{section_link}/#{date.year}/#{Date::ABBR_MONTHNAMES[date.month].downcase}/#{date.day}/#{slug}##{anchor_id}"
  end
  
  def speaker_slug
    person.slug if person
  end
  
  def speaker_name
    person.name if person
  end
    
  def house<commit_msg>returning the honorific as part of speaker_name<commit_after># encoding: utf-8

require 'acts_as_solr'
require './lib/acts_as_solr_hacks/search_results.rb'

class Contribution < ActiveRecord::Base
  acts_as_solr :fields => [:solr_text, {:person_id => :facet},
                                       {:date => :facet},
                                       {:year => :facet},
                                       {:decade => :facet},
                                       {:sitting_type => :facet}],
               :facets => [:person_id, {:date => :date}, :year, :decade]
               
  self.solr_configuration  =  { :type_field => "type_t",
                                :primary_key_field => "pk_i",
                                :default_boost => 1.0 }
  
  belongs_to :person
  
  def url
    "#{section_link}/#{date.year}/#{Date::ABBR_MONTHNAMES[date.month].downcase}/#{date.day}/#{slug}##{anchor_id}"
  end
  
  def speaker_slug
    person.slug if person
  end
  
  def speaker_name
    "#{person.honorific} #{person.name}" if person
  end
    
  def house
{'fraction_non_alphanumeric': 0.1317680881648299, 'fraction_numerical': 0.0028749401054144704, 'mean_word_length': 1.6330390920554856, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1643166', 'n_tokens_mistral': 667, 'n_tokens_neox': 665, 'n_words': 118}