<commit_before>package com.identityblitz.json

import scala.annotation.implicitNotFound
import scala.reflect.ClassTag
import scala.collection.generic.CanBuildFrom

/**
 *
 */
@implicitNotFound("No JSON reader found for type ${T}. Try to implement an implicit JReader.")
trait JReader[T] {

  def read(v: JVal): JResult[T]

}

object JReader extends DefaultJReaders

trait DefaultJReaders {

  implicit object IntJReader extends JReader[Int] {
    def read(v: JVal): JResult[Int] = v match {
      case JNum(i) => JSuccess(i.toInt)
      case _ => JError("json.error.expected.number")
    }
  }

  implicit object StringJReader extends JReader[String] {
    def read(v: JVal): JResult[String] = v match {
      case JStr(s) => JSuccess(s)
      case _ => JError("json.error.expected.string")
    }
  }

  implicit object BooleanJReader extends JReader[Boolean] {
    def read(v: JVal): JResult[Boolean] = v match {
      case JBool(b) => JSuccess(b)
      case _ => JError("json.error.expected.boolean")
    }
  }
<commit_msg>add jReader for Long type<commit_after>package com.identityblitz.json

import scala.annotation.implicitNotFound
import scala.reflect.ClassTag
import scala.collection.generic.CanBuildFrom

/**
 *
 */
@implicitNotFound("No JSON reader found for type ${T}. Try to implement an implicit JReader.")
trait JReader[T] {

  def read(v: JVal): JResult[T]

}

object JReader extends DefaultJReaders

trait DefaultJReaders {

  implicit object IntJReader extends JReader[Int] {
    def read(v: JVal): JResult[Int] = v match {
      case JNum(i) => JSuccess(i.toInt)
      case _ => JError("json.error.expected.number")
    }
  }

  implicit object LongJReader extends JReader[Long] {
    def read(v: JVal): JResult[Long] = v match {
      case JNum(i) => JSuccess(i.toLong)
      case _ => JError("json.error.expected.number")
    }
  }

  implicit object StringJReader extends JReader[String] {
    def read(v: JVal): JResult[String] = v match {
      case JStr(s) => JSuccess(s)
      case _ => JError("json.error.expected.string")
    }
  }

  implicit object BooleanJReader extends JReader[Boolean] {
    def read(v: JVal): JResult[Boolean] = v match {
      case JBool(b) => JSuccess(b)
      case _ => JError("json.error.expected.boolean")
    }
  }

{'fraction_non_alphanumeric': 0.12202643171806167, 'fraction_numerical': 0.0, 'mean_word_length': 3.5786290322580645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '3429526', 'n_tokens_mistral': 753, 'n_tokens_neox': 754, 'n_words': 182}