<commit_before>package com.github.sameersingh.bibere

import org.junit.Test
import org.junit.Assert._
import com.google.common.io.Files

/**
 * @author sameer
 */
class WritingTest {

  def synthPubs: Publications = {
    val result = new Publications
    // authors
    result += Author("sameer", PersonName("Sameer", "Singh"), Some("http://www.cs.umass.edu/~sameer"))
    result += Author("andrew", PersonName("Andrew", "McCallum", Some("K.")), None)
    // venues
    result += Venue("icml", "International Conference on Machine Learning (ICML)", "ICML")
    result += Venue("biglearn", "NIPS Workshop on Big Learning", "BigLearning")
    // papers
    result += Paper("biglearn11", "Towards Asynchronous Distributed MCMC Inference for Large Graphical Models",
      PubType.Workshop.toString, 2011, Seq("sameer", "andrew"), "biglearn")

    result
  }

  @Test
  def testCaseClassWriting() {
    val testDir = Files.createTempDir().toString
    println(testDir)
    JsonWriter.write(synthPubs, testDir)
    val pubs = JsonReader.readPublications(testDir)
    println("authors: " + pubs.authors.values)
    println("venues: " + pubs.venues.values)
    println("papers: " + pubs.papers.values)
  }

  @Test
  def testHTMLWriting() {
    val testDir = Files.createTempDir().toString
    println(testDir)
    HTMLWriter.write(synthPubs, testDir)
  }

  @Test
  def testBibtexWriting() {
    val testDir = Files.createTempDir().toString
    println(testDir)
    BibtexWriter.write(synthPubs, testDir)
  }
}
<commit_msg>add fields in the example<commit_after>package com.github.sameersingh.bibere

import org.junit.Test
import org.junit.Assert._
import com.google.common.io.Files

/**
 * @author sameer
 */
class WritingTest {

  def synthPubs: Publications = {
    val result = new Publications
    // authors
    result += Author("sameer", PersonName("Sameer", "Singh"), Some("http://www.cs.umass.edu/~sameer"))
    result += Author("andrew", PersonName("Andrew", "McCallum", Some("K.")), None)
    // venues
    result += Venue("icml", "International Conference on Machine Learning (ICML)", "ICML")
    result += Venue("biglearn", "NIPS Workshop on Big Learning", "BigLearning")
    // papers
    result += Paper("biglearn11", "Towards Asynchronous Distributed MCMC Inference for Large Graphical Models",
      PubType.Workshop.toString, 2011, Seq("sameer", "andrew"), "biglearn", Some("abstract text"), Some("pdf-link"),
      Some("ppt-link"), Some((10,100)), Seq(("project", "project-link")), Seq(("tr-num", "UMASS-CS-2013")))

    result
  }

  @Test
  def testCaseClassWriting() {
    val testDir = Files.createTempDir().toString
    println(testDir)
    JsonWriter.write(synthPubs, testDir)
    val pubs = JsonReader.readPublications(testDir)
    println("authors: " + pubs.authors.values)
    println("venues: " + pubs.venues.values)
    println("papers: " + pubs.papers.values)
  }

  @Test
  def testHTMLWriting() {
    val testDir = Files.createTempDir().toString
    println(testDir)
    HTMLWriter.write(synthPubs, testDir)
  }

  @Test
  def testBibtexWriting() {
    val testDir = Files.createTempDir().toString
    println(testDir)
    BibtexWriter.write(synthPubs, testDir)
  }
}

{'fraction_non_alphanumeric': 0.14544885830466062, 'fraction_numerical': 0.0065686581169846735, 'mean_word_length': 3.9504643962848296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2563539', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1015, 'n_words': 219}