<commit_before>module GBTiles
  module DataType
    def self.string(src, length = nil)
      if src.nil? then
        return nil
      end

      if !length.nil? then
        string = src.slice(0, length)
      else
        string = src
      end

      string = string.split(/\0/).first
      string = string.unpack("A*")[0]
      string
    end

    def self.string!(src, length = nil)
      if src.nil? then
        return nil
      end

      if !length.nil? then<commit_msg>using nil checking for string data type conversion<commit_after>module GBTiles
  module DataType
    def self.string(src, length = nil)
      if src.nil? then
        return nil
      end

      if !length.nil? then
        string = src.slice(0, length)
      else
        string = src
      end

      if !string.nil? then
        string = string.split(/\0/).first
      end

      if !string.nil? then
        string = string.unpack("A*")[0]
      end

      string
    end

    def self.string!(src, length = nil)
      if src.nil? then
        return nil
      end

      if !length.nil? then
{'fraction_non_alphanumeric': 0.09302325581395349, 'fraction_numerical': 0.005581395348837209, 'mean_word_length': 1.6766169154228856, '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': '4298982', 'n_tokens_mistral': 338, 'n_tokens_neox': 327, 'n_words': 100}