<commit_before>module SemanticRange
  VERSION = "0.1.0"

  class Version
    def initialize(version, loose)
      @raw = version
      @loose = loose

      if version.is_a?(Version)
        return version
      end

      match = version.strip.match(loose ? LOOSE : FULL)
      # TODO error handling

      @major = match[1].to_i
      @minor = match[2].to_i
      @patch = match[3].to_i

      # TODO error handling

      if !match[4]
        @prerelease = []
      else
        @prerelease = match[4].split('.').map do |id|
          if /^[0-9]+$/.match(id)
            num = id.to_i
            # TODO error handling
          else
            id
          end
        end
      end

      @build = match[5] ? match[5].split('.') : []
      @version = format
    end

    def version
      @version
    end

    def major
      @major
    end

    def minor
      @minor
    end<commit_msg>handle missing matches<commit_after>module SemanticRange
  VERSION = "0.1.0"

  class Version
    def initialize(version, loose)
      @raw = version
      @loose = loose

      if version.is_a?(Version)
        return version
      end

      match = version.strip.match(loose ? LOOSE : FULL)
      # TODO error handling

      @major = match[1] ? match[1].to_i : 0
      @minor = match[2] ? match[2].to_i : 0
      @patch = match[3] ? match[3].to_i : 0

      # TODO error handling

      if !match[4]
        @prerelease = []
      else
        @prerelease = match[4].split('.').map do |id|
          if /^[0-9]+$/.match(id)
            num = id.to_i
            # TODO error handling
          else
            id
          end
        end
      end

      @build = match[5] ? match[5].split('.') : []
      @version = format
    end

    def version
      @version
    end

    def major
      @major
    end

    def minor
      @minor
    end
{'fraction_non_alphanumeric': 0.11279826464208242, 'fraction_numerical': 0.016268980477223426, 'mean_word_length': 1.496617050067659, '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': '97669', 'n_tokens_mistral': 615, 'n_tokens_neox': 583, 'n_words': 151}