<commit_before>class Chemical
  include HTTParty
  
  base_uri "cactus.nci.nih.gov/chemical/structure/"
  
  attr_accessor :structure_identifier, :stdinchikey
  
  def initialize(structure_identifier, stdinchikey=nil)
    @structure_identifier = structure_identifier
    @stdinchikey = nil
  end

  def inchikey()
    response = self.class.get("/#{@structure_identifier}/stdinchikey")
    if response.parsed_response =~ /.*=(.*)/
      @stdinchikey = $1
    else
      puts "can't parse strucutre"  
    end
  end
end<commit_msg>added name to smiles method<commit_after>class Chemical
  include HTTParty
  
  base_uri "cactus.nci.nih.gov/chemical/structure/"
  
  attr_accessor :name, :stdinchikey, :smiles
  
  def initialize(name, stdinchikey=nil, smiles=nil)
    @name = name
    @stdinchikey = stdinchikey
    @smiles = smiles
  end

  def name_to_stdinchikey()
    response = self.class.get("/#{@structure_identifier.gsub(/\s+/, "")}/stdinchikey")
    if response.parsed_response =~ /.*=(.*)/
      @stdinchikey = $1
    else
      puts "can't parse strucutre"  
    end
  end
  
  def name_to_smiles()
    response = self.class.get("/#{@structure_identifier.gsub(/\s+/, "")}/smiles")
    @smiles = response.parsed_response
  end
  
end
{'fraction_non_alphanumeric': 0.12409347300564061, 'fraction_numerical': 0.0016116035455278, 'mean_word_length': 3.3426573426573425, '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': '430757', 'n_tokens_mistral': 441, 'n_tokens_neox': 438, 'n_words': 82}