<commit_before>package com.github.chengpohi

import com.github.chengpohi.helper.ResponseGenerator
import com.github.chengpohi.parser.ELK
import com.github.chengpohi.parser.ELKParser
import scala.io.Source

/**
 * Created by chengpohi on 1/3/16.
 */
class ELKRunEngine(functions: Map[String, (Seq[ELK.Instrument], Map[String, String])]) {
  val responseGenerator = new ResponseGenerator
  import responseGenerator._
  def runInstruments(instruments: Seq[ELK.Instrument], variables: Map[String, String]): Unit = {
    instruments.foreach {
      case i: ELK.Instrument => i.value match {
        case (name, Some(ins), parameters) =>
          try {
            val response: String = ins(parameters)
            println(beautyJSON(response))
          } catch {
            case e: Exception => {
              e.printStackTrace()
              //println(s"\nMethod Name: ${name} \nParameters: ${parameters}\nFull Stacktrace: ${e.getCause.getLocalizedMessage}")
            }
          }
      }
    }
  }
}

object ELKRunEngine {
  val ep = new ELKParser
  import ep._
  def main(args: Array[String]): Unit = {
    if (args.length != 1) {
      println("usage elk file.elk")
      System.exit(0)
    }
    val parseFile: String = Source.fromFile(args(0)).getLines().filter(!_.trim().startsWith("//")).toList.mkString("")
    run(parseFile)
  }
<commit_msg>DONE:---TODO:<commit_after>package com.github.chengpohi

import com.github.chengpohi.helper.ResponseGenerator
import com.github.chengpohi.parser.ELK
import com.github.chengpohi.parser.ELKParser
import scala.io.Source

/**
 * Created by chengpohi on 1/3/16.
 */
class ELKRunEngine(functions: Map[String, (Seq[ELK.Instrument], Map[String, String])]) {
  val responseGenerator = new ResponseGenerator
  import responseGenerator._
  def runInstruments(instruments: Seq[ELK.Instrument], variables: Map[String, String]): Unit = {
    instruments.foreach {
      case i: ELK.Instrument => i.value match {
        case (name, Some(ins), parameters) =>
          try {
            val response: String = ins(parameters)
            println(beautyJSON(response))
          } catch {
            case e: Exception => {
              println(s"\nMethod Name: ${name} \nParameters: ${parameters}\nFull Stacktrace: ${e.getCause.getLocalizedMessage}")
            }
          }
      }
    }
  }
}

object ELKRunEngine {
  val ep = new ELKParser
  import ep._
  def main(args: Array[String]): Unit = {
    if (args.length != 1) {
      println("usage elk file.elk")
      System.exit(0)
    }
    val parseFile: String = Source.fromFile(args(0)).getLines().filter(!_.trim().startsWith("//")).toList.mkString("")
    run(parseFile)
  }

{'fraction_non_alphanumeric': 0.13602391629297458, 'fraction_numerical': 0.00523168908819133, 'mean_word_length': 2.9137426900584797, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2977065', 'n_tokens_mistral': 859, 'n_tokens_neox': 847, 'n_words': 171}