<commit_before>require 'bel'

require_relative 'citation'
require_relative 'summary_text'
require_relative 'experiment_context'
require_relative 'references'
require_relative 'metadata'

module BEL
  module Model

    class Evidence
      def self.create(hash)
        ev = Evidence.new
        ev.bel_statement      = hash[:bel_statement] || nil
        ev.citation           = Citation.new(hash[:citation] || {})
        ev.summary_text.value = hash[:summary_text] || nil
        ev.experiment_context = ExperimentContext.new(hash[:experiment_context] || [])
        ev.references         = References.new(hash[:references] || {})
        ev.metadata           = Metadata.new(hash[:metadata] || {})
        ev
      end

      def self.parse_statement(evidence)
        namespaces = evidence.references.namespaces
        ::BEL::Script.parse(
          "#{evidence.bel_statement}\n",
          Hash[
            namespaces.map { |ns|
              keyword, uri = ns.values_at(:keyword, :uri)
              sym          = keyword.to_sym
              [
                sym,
                ::BEL::Namespace::NamespaceDefinition.new(sym, uri, uri)
              ]
            }
          ]
        ).select { |obj|
          obj.is_a? ::BEL::Model::Statement<commit_msg>[temp] pull support from :support/:summary_text<commit_after>require 'bel'

require_relative 'citation'
require_relative 'summary_text'
require_relative 'experiment_context'
require_relative 'references'
require_relative 'metadata'

module BEL
  module Model

    class Evidence
      def self.create(hash)
        ev = Evidence.new
        ev.bel_statement      = hash[:bel_statement] || nil
        ev.citation           = Citation.new(hash[:citation] || {})
        ev.summary_text.value = hash[:support] || hash[:summary_text] || nil
        ev.experiment_context = ExperimentContext.new(hash[:experiment_context] || [])
        ev.references         = References.new(hash[:references] || {})
        ev.metadata           = Metadata.new(hash[:metadata] || {})
        ev
      end

      def self.parse_statement(evidence)
        namespaces = evidence.references.namespaces
        ::BEL::Script.parse(
          "#{evidence.bel_statement}\n",
          Hash[
            namespaces.map { |ns|
              keyword, uri = ns.values_at(:keyword, :uri)
              sym          = keyword.to_sym
              [
                sym,
                ::BEL::Namespace::NamespaceDefinition.new(sym, uri, uri)
              ]
            }
          ]
        ).select { |obj|
          obj.is_a? ::BEL::Model::Statement
{'fraction_non_alphanumeric': 0.11728395061728394, 'fraction_numerical': 0.0, 'mean_word_length': 2.050588235294118, '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': '5506090', 'n_tokens_mistral': 737, 'n_tokens_neox': 716, 'n_words': 126}