<commit_before>require 'active_support/concern'

module ExternalDataMappings
  extend ActiveSupport::Concern
  
  module ClassMethods
    def map_connection_to_id(val)
      sym = case val
      when "Broadband at home (cable, DSL, etc.)", "Broadband at home (e.g. cable or DSL)"
        :home_broadband
      when "Public computer center"
        :public_computer
      when "Phone plan with data"
        :phone
      when "Public wi-fi", "Public Wi-Fi"
        :public_wifi
      when "Other"
        :other
      end

      Logan::Application.config.connection_mappings[sym]    
    end

    def map_device_to_id(val)
        sym = case val<commit_msg>Change Case statements in external_data_mappings to accept any text as Other<commit_after>require 'active_support/concern'

module ExternalDataMappings
  extend ActiveSupport::Concern
  
  module ClassMethods
    def map_connection_to_id(val)
      sym = case val
      when "Broadband at home (cable, DSL, etc.)", "Broadband at home (e.g. cable or DSL)"
        :home_broadband
      when "Public computer center"
        :public_computer
      when "Phone plan with data"
        :phone
      when "Public wi-fi", "Public Wi-Fi"
        :public_wifi
      else
        :other
      end

      Logan::Application.config.connection_mappings[sym]    
    end

    def map_device_to_id(val)
        sym = case val
{'fraction_non_alphanumeric': 0.07461594732991954, 'fraction_numerical': 0.0, 'mean_word_length': 2.5625, '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': '2131000', 'n_tokens_mistral': 421, 'n_tokens_neox': 406, 'n_words': 120}