<commit_before>module Prmd
  def self.combine(directory)
    # FIXME: where to get description/title from?
    #  "description":  "The direwolf API empowers developers to automate Heroku platform integration testing.",
    #  "title":        "Heroku Direwolf API",
    template = <<-SCHEMA_TEMPLATE
    {
      "definitions":  {
        <%- schemata.each do |key, schema| %>
        "<%= key %>": <%= schema %><%= ',' unless key == schemata.keys.last %>
        <%- end -%>
      },
      "properties":   {
        <%- schemata.each do |key, schema| %>
        "<%= key %>": { "$ref": "#/definitions/<%= key %>" }<%= ',' unless key == schemata.keys.last %>
        <%- end -%>
      },
      "$schema":      "http://json-schema.org/draft-04/hyper-schema",
      "type":         ["object"]
    }
    SCHEMA_TEMPLATE

    schemata = {}

    Dir.glob(File.join(directory, '*.json')).each do |path|<commit_msg>remove description/title FIXME, handled by _meta<commit_after>module Prmd
  def self.combine(directory)
    template = <<-SCHEMA_TEMPLATE
    {
      "definitions":  {
        <%- schemata.each do |key, schema| %>
        "<%= key %>": <%= schema %><%= ',' unless key == schemata.keys.last %>
        <%- end -%>
      },
      "properties":   {
        <%- schemata.each do |key, schema| %>
        "<%= key %>": { "$ref": "#/definitions/<%= key %>" }<%= ',' unless key == schemata.keys.last %>
        <%- end -%>
      },
      "$schema":      "http://json-schema.org/draft-04/hyper-schema",
      "type":         ["object"]
    }
    SCHEMA_TEMPLATE

    schemata = {}

    Dir.glob(File.join(directory, '*.json')).each do |path|
{'fraction_non_alphanumeric': 0.20195241000610129, 'fraction_numerical': 0.0024405125076266015, 'mean_word_length': 2.215686274509804, 'pattern_counts': {'":': 16, '<': 27, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2598559', 'n_tokens_mistral': 588, 'n_tokens_neox': 544, 'n_words': 106}