<commit_before>package org.tribbloid.spookystuff.repl

import org.apache.spark.repl.SparkILoop
import org.apache.spark.sql.SQLContext

import scala.collection.immutable
import scala.tools.nsc.interpreter.{Results, NamedParam}

class SpookyILoop extends SparkILoop {

  private val postInitScript =
    "import scala.concurrent.duration._" ::
      "import org.tribbloid.spookystuff.actions._" ::
      "import org.tribbloid.spookystuff.factory.driver._" ::
      "import org.tribbloid.spookystuff.expressions._" ::
      "import org.tribbloid.spookystuff.SpookyContext" ::
      "val spooky = new SpookyContext(sql)" ::
      "import spooky._" ::
      Nil

  override protected def postInitialization() {
    super.postInitialization()
    this.beQuietDuring {
      val sql = new SQLContext(this.sparkContext)
      val sqlParam = NamedParam[SQLContext]("sql", sql)
      intp.bind(sqlParam.name, sqlParam.tpe, sqlParam.value, immutable.List("@transient")) match {
        case Results.Success =>
        case _ => throw new RuntimeException("SQL failed to initialize")
      }

      postInitScript.foreach(command)
    }
  }

  override def prompt: String = "spooky> "

  override def printWelcome(): Unit = {
    echo(
      """
        |      ____                / /
        |     / __/__  ___  ___   / /__ _   _
        |    _\ \/ _ \/ _ \/ _ \ /  '_// |_/ /
        |   /___/ .__/\___/\___//_/\_\ \_.  /  STUFF  version 0.3.0-SNAPSHOT
        |      / /                      _/ /
        |     / /                      /__/

      """)
    import scala.tools.nsc.Properties._
    val welcomeMsg = "Using Scala %s (%s, Java %s)".format(
      versionString, javaVmName, javaVersion)
    echo(welcomeMsg)
    echo("Type in queries to have them executed.")
    echo("Type :help for more information.")
  }
}
<commit_msg>Remove factory.driver which no longer exist and add dsl instead<commit_after>package org.tribbloid.spookystuff.repl

import org.apache.spark.repl.SparkILoop
import org.apache.spark.sql.SQLContext

import scala.collection.immutable
import scala.tools.nsc.interpreter.{Results, NamedParam}

class SpookyILoop extends SparkILoop {

  private val postInitScript =
    "import scala.concurrent.duration._" ::
      "import org.tribbloid.spookystuff.actions._" ::
      "import org.tribbloid.spookystuff.dsl._" ::
      "import org.tribbloid.spookystuff.expressions._" ::
      "import org.tribbloid.spookystuff.SpookyContext" ::
      "val spooky = new SpookyContext(sql)" ::
      "import spooky._" ::
      Nil

  override protected def postInitialization() {
    super.postInitialization()
    this.beQuietDuring {
      val sql = new SQLContext(this.sparkContext)
      val sqlParam = NamedParam[SQLContext]("sql", sql)
      intp.bind(sqlParam.name, sqlParam.tpe, sqlParam.value, immutable.List("@transient")) match {
        case Results.Success =>
        case _ => throw new RuntimeException("SQL failed to initialize")
      }

      postInitScript.foreach(command)
    }
  }

  override def prompt: String = "spooky> "

  override def printWelcome(): Unit = {
    echo(
      """
        |      ____                / /
        |     / __/__  ___  ___   / /__ _   _
        |    _\ \/ _ \/ _ \/ _ \ /  '_// |_/ /
        |   /___/ .__/\___/\___//_/\_\ \_.  /  STUFF  version 0.3.0-SNAPSHOT
        |      / /                      _/ /
        |     / /                      /__/

      """)
    import scala.tools.nsc.Properties._
    val welcomeMsg = "Using Scala %s (%s, Java %s)".format(
      versionString, javaVmName, javaVersion)
    echo(welcomeMsg)
    echo("Type in queries to have them executed.")
    echo("Type :help for more information.")
  }
}

{'fraction_non_alphanumeric': 0.1252371916508539, 'fraction_numerical': 0.001626457034426674, 'mean_word_length': 2.170103092783505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6744710', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1199, 'n_words': 215}