<commit_before>package com.cyrusinnovation.computation.persistence.writer

import java.io.{OutputStreamWriter, OutputStream}
import org.yaml.snakeyaml.Yaml
import java.util.{HashMap => JHMap}
import java.util.{Map => JMap}
import collection.JavaConverters._
import org.joda.time.DateTime
import java.text.SimpleDateFormat

object YamlWriter {
  def forOutputStream(outputStream: OutputStream): Writer = {
    new YamlWriter(outputStream, new Yaml())
  }
}

class YamlWriter(stream: OutputStream, snakeYaml: Yaml) extends Writer {

  sealed abstract class Node

  case class EntryNode(label: String, attrs: Map[String, String], children: List[Context]) extends Node

  case class ListNode(label: String, children: List[String]) extends Node

  case class ContextListNode(label: String, children: List[Context]) extends Node

  case class MapNode(label: String, children: Map[String, String]) extends Node
<commit_msg>fix yaml to use indents to denote objects instead of { } This prevents small objects like library and version from being rolled up into one line<commit_after>package com.cyrusinnovation.computation.persistence.writer

import java.io.{OutputStreamWriter, OutputStream}
import org.yaml.snakeyaml.{DumperOptions, Yaml}
import java.util.{HashMap => JHMap}
import java.util.{Map => JMap}
import collection.JavaConverters._
import org.joda.time.DateTime
import java.text.SimpleDateFormat

object YamlWriter {
  def forOutputStream(outputStream: OutputStream): Writer = {
    val opts = new DumperOptions()
    //When writing yaml: Use indents to denote objects instead of { }
    //This prevents small objects like library and version from being rolled up into one line
    opts.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK)
    new YamlWriter(outputStream, new Yaml(opts))
  }
}

class YamlWriter(stream: OutputStream, snakeYaml: Yaml) extends Writer {

  sealed abstract class Node

  case class EntryNode(label: String, attrs: Map[String, String], children: List[Context]) extends Node

  case class ListNode(label: String, children: List[String]) extends Node

  case class ContextListNode(label: String, children: List[Context]) extends Node

  case class MapNode(label: String, children: Map[String, String]) extends Node

{'fraction_non_alphanumeric': 0.08738296923762817, 'fraction_numerical': 0.0, 'mean_word_length': 5.523255813953488, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1896035', 'n_tokens_mistral': 629, 'n_tokens_neox': 622, 'n_words': 207}