<commit_before># encoding: utf-8

module Crunchbase::Model
  class Entity

    attr_reader :type_name, :uuid

    VALID_SEARCH_MODELS = ['organizations', 'people', 'products', 'ipos', 'acquisitions', 'funding-rounds']

    def initialize(json)
      instance_variable_set("@type_name",  json['type'] || nil)
      instance_variable_set("@uuid",  json['uuid'] || nil)

      properties = json['properties']
      property_keys.each { |v| instance_variable_set("@#{v}", properties[v]) }
      date_keys.each { |v| instance_variable_set("@#{v}", properties[v].nil? ? nil : Date.parse(properties[v])) }

      instance_timestamps(properties)
    end
<commit_msg>Initialize property key in json to avoid null errors<commit_after># encoding: utf-8

module Crunchbase::Model
  class Entity

    attr_reader :type_name, :uuid

    VALID_SEARCH_MODELS = ['organizations', 'people', 'products', 'ipos', 'acquisitions', 'funding-rounds']

    def initialize(json)
      instance_variable_set("@type_name",  json['type'] || nil)
      instance_variable_set("@uuid",  json['uuid'] || nil)

      properties = json['properties'] || {}
      property_keys.each { |v| instance_variable_set("@#{v}", properties[v]) }
      date_keys.each { |v| instance_variable_set("@#{v}", properties[v].nil? ? nil : Date.parse(properties[v])) }

      instance_timestamps(properties)
    end

{'fraction_non_alphanumeric': 0.15870683321087437, 'fraction_numerical': 0.0014695077149155032, 'mean_word_length': 4.559183673469388, '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': '5500721', 'n_tokens_mistral': 439, 'n_tokens_neox': 429, 'n_words': 86}