<commit_before>module Results
  # Import Excel results file
  #
  # Result time limited to hundredths of seconds
  #
  # Notes example:
  # Senior Men Pro 1/2 | Field size: 79 riders | Laps: 2
  #
  # Set DEBUG_RESULTS to Toggle expensive debug logging. E.g., DEBUG_RESULTS=yes ./script/server
  class ResultsFile
    attr_accessor :columns
    attr_accessor :column_indexes
    attr_accessor :event
    attr_accessor :rows
    attr_accessor :source

    # All custom columns in file
    attr_accessor :custom_columns
    
    # Custom columns just for Race
    attr_accessor :race_custom_columns

    attr_accessor :import_warnings

    COLUMN_MAP = {
      "placing"           => "place",
      ";place"            => "place",
      "pl"                => "place",
      "#"                 => "number",
      "wsba#"             => "number",
      "rider_#"           => "number",
      'racing_age'        => 'age',
      'age'               => 'age',
      "gender"            => "gender",
      "barcategory"       => "parent",
      "bar_category"      => "parent",
      "category.name"     => "category_name",
      "categories"        => "category_name",
      "category"          => "category_name",
      "cat."              => "category_name",
      "class"             => "category_class",  # Example: A for Masters A
      "first"             => "first_name",
      "firstname"         => "first_name",
      "person.first_name" => "first_name",
      "person"            => "name",
      "lane"              => "category_name",
      "last"              => "last_name",
      "lastname"          => "last_name",
      "person.last_name"  => "last_name",
      "team"              => "team_name",
      "team.name"         => "team_name",
      "bib"               => "number",
      "bib_#"             => "number",
      "obra_number"       => "number",
      "oregoncup"         => "oregon_cup",
      "membership_#"      => "license",
      "membership"        => "license",
      "license_#"         => "license",
      "team/club"         => "team_name",
      "club/team"         => "team_name",
      "hometown"          => 'city',
      "stage_time"        => "time",
      "st"                => "time",
      "stop_time"         => "time",
      "bonus"             => "time_bonus_penalty",
      "penalty"           => "time_bonus_penalty",
      "stage_+_penalty"   => "time_total",
      "time"              => "time",
      "time_total"        => "time_total",
      "total_time"        => "time_total",
      "down"              => "time_gap_to_leader",
      "gap"               => "time_gap_to_leader",
      "delta_time"        => "time_gap_to_leader",
      "pts"               => "points",
      "sex"               => "gender"
    }

    def initialize(source, event)<commit_msg>Translate total points to points total<commit_after>module Results
  # Import Excel results file
  #
  # Result time limited to hundredths of seconds
  #
  # Notes example:
  # Senior Men Pro 1/2 | Field size: 79 riders | Laps: 2
  #
  # Set DEBUG_RESULTS to Toggle expensive debug logging. E.g., DEBUG_RESULTS=yes ./script/server
  class ResultsFile
    attr_accessor :columns
    attr_accessor :column_indexes
    attr_accessor :event
    attr_accessor :rows
    attr_accessor :source

    # All custom columns in file
    attr_accessor :custom_columns
    
    # Custom columns just for Race
    attr_accessor :race_custom_columns

    attr_accessor :import_warnings

    COLUMN_MAP = {
      "placing"           => "place",
      ";place"            => "place",
      "pl"                => "place",
      "#"                 => "number",
      "wsba#"             => "number",
      "rider_#"           => "number",
      'racing_age'        => 'age',
      'age'               => 'age',
      "gender"            => "gender",
      "barcategory"       => "parent",
      "bar_category"      => "parent",
      "category.name"     => "category_name",
      "categories"        => "category_name",
      "category"          => "category_name",
      "cat."              => "category_name",
      "class"             => "category_class",  # Example: A for Masters A
      "first"             => "first_name",
      "firstname"         => "first_name",
      "person.first_name" => "first_name",
      "person"            => "name",
      "lane"              => "category_name",
      "last"              => "last_name",
      "lastname"          => "last_name",
      "person.last_name"  => "last_name",
      "team"              => "team_name",
      "team.name"         => "team_name",
      "bib"               => "number",
      "bib_#"             => "number",
      "obra_number"       => "number",
      "oregoncup"         => "oregon_cup",
      "membership_#"      => "license",
      "membership"        => "license",
      "license_#"         => "license",
      "team/club"         => "team_name",
      "club/team"         => "team_name",
      "hometown"          => 'city',
      "stage_time"        => "time",
      "st"                => "time",
      "stop_time"         => "time",
      "bonus"             => "time_bonus_penalty",
      "penalty"           => "time_bonus_penalty",
      "stage_+_penalty"   => "time_total",
      "time"              => "time",
      "time_total"        => "time_total",
      "total_time"        => "time_total",
      "down"              => "time_gap_to_leader",
      "gap"               => "time_gap_to_leader",
      "delta_time"        => "time_gap_to_leader",
      "pts"               => "points",
      "total_points"      => "points_total",
      "sex"               => "gender"
    }

    def initialize(source, event)
{'fraction_non_alphanumeric': 0.14398456681866012, 'fraction_numerical': 0.00175377060680463, 'mean_word_length': 1.5482573726541555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 104, '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': '92791', 'n_tokens_mistral': 1773, 'n_tokens_neox': 1713, 'n_words': 348}