<commit_before>module Matchable

  def participants_same_full_name # For situations where middle names are sometimes included with first_name and sometimes with last_name
    participants = Participant.gender_matches(gender) # To limit pool of search options
    Participant.full_name_matches(full_name, participants) || Participant.none
  end

  def participants_changed_first_name # To pick up discrepancies in first names #TODO use levensthein alagorithm
    participants = Participant.last_name_matches(last_name).gender_matches(gender).all
    Participant.age_matches(age_today, participants) || Participant.none
  end

  def participants_changed_last_name # To find women who may have changed their last names
    participants = Participant.female.first_name_matches(first_name).state_matches(state_code).all
    Participant.age_matches(age_today, participants) || Participant.none
  end
<commit_msg>Bug fix resulting from state_matches returning array instead of activerecord relation<commit_after>module Matchable

  def participants_same_full_name # For situations where middle names are sometimes included with first_name and sometimes with last_name
    participants = Participant.gender_matches(gender) # To limit pool of search options
    Participant.full_name_matches(full_name, participants) || Participant.none
  end

  def participants_changed_first_name # To pick up discrepancies in first names #TODO use levensthein alagorithm
    participants = Participant.last_name_matches(last_name).gender_matches(gender).all
    Participant.age_matches(age_today, participants) || Participant.none
  end

  def participants_changed_last_name # To find women who may have changed their last names
    participants = Participant.female.first_name_matches(first_name).state_matches(state_code)
    Participant.age_matches(age_today, participants) || Participant.none
  end

{'fraction_non_alphanumeric': 0.052659574468085106, 'fraction_numerical': 0.0, 'mean_word_length': 5.966666666666667, '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': '7198513', 'n_tokens_mistral': 506, 'n_tokens_neox': 490, 'n_words': 144}