<commit_before>require 'digest'
require 'faraday'
require 'json'
require 'net/http'
require 'nokogiri'
require 'openssl'

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

module  WeixinPublicClient
class WeixinObject
  def initialize(params)
  	params.each{|var,val| self.send "#{var}=", val if self.class.instance_methods.include?(var)}
  end
end

class AppMsg < WeixinObject
  attr_accessor :appId,:title,:time
end

class WeixinFan < WeixinObject
  attr_accessor :fakeId,:nickName,:remarkName,:groupId
end

class WeixinMessage < WeixinObject
  attr_accessor :fileId,:source,:fakeId,:hasReply,:nickName,:remarkName,:dateTime,:id,:type,:content

  def filePath
    file_type = {"2"=>"jpg","3"=>"mp3","4"=>"mp4"}[@type]
    "#{@id}.#{file_type}"
  end

  def fileType
    filetype={"2"=>"image/jpg","3"=>"audio/mp3","4"=>"video/mp4"}[@type]
  end
end

  <commit_msg>json object read error bug fix<commit_after>require 'digest'
require 'faraday'
require 'json'
require 'net/http'
require 'nokogiri'
require 'openssl'

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

module  WeixinPublicClient
class WeixinObject
  def initialize(params)
  	params.each { |var,val| self.send "#{var}=", val if self.class.instance_methods.include?(var.to_sym)}
  end
end

class AppMsg < WeixinObject
  attr_accessor :appId,:title,:time
end

class WeixinFan < WeixinObject
  attr_accessor :fakeId,:nickName,:remarkName,:groupId
end

class WeixinMessage < WeixinObject
  attr_accessor :fileId,:source,:fakeId,:hasReply,:nickName,:remarkName,:dateTime,:id,:type,:content

  def filePath
    file_type = {"2"=>"jpg","3"=>"mp3","4"=>"mp4"}[@type]
    "#{@id}.#{file_type}"
  end

  def fileType
    filetype={"2"=>"image/jpg","3"=>"audio/mp3","4"=>"video/mp4"}[@type]
  end
end

  
{'fraction_non_alphanumeric': 0.16572398190045248, 'fraction_numerical': 0.011312217194570135, 'mean_word_length': 6.401673640167364, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5240032', 'n_tokens_mistral': 704, 'n_tokens_neox': 690, 'n_words': 118}