<commit_before>/*
 * Copyright 2011-2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ckkloverdos


package object convert {
  final val EmptyHint: AnyRef = new java.lang.Object

  type Type[A] = Manifest[A]

  @inline
  def typeOf[T: Type]: Type[T] = Predef.manifest[T]

  @inline
  def erasureOf[T: Type]: Class[T] = typeOf[T].erasure.asInstanceOf[Class[T]]

  private[convert]
  def typeOfClass[T](clazz: Class[T]): Type[_ <: AnyRef] = {
    if(clazz.isArray) {
      Manifest.arrayType(typeOfClass(clazz.getComponentType))
    } else {
      Manifest.classType(clazz)
    }
  }

  private[convert]
  def typeOfAny[A](any: A): Type[_ <: Any] = {
    any match {
      case byte: Byte =>
        Manifest.Byte
      case byte: Boolean =>
        Manifest.Boolean
      case short: Short =>
        Manifest.Short
      case byte: Char =>
        Manifest.Char
      case any: Int =>
        Manifest.Int
      case long: Long =>
        Manifest.Long
      case float: Float =>
        Manifest.Float
      case double: Double =>
        Manifest.Double
      case unit: Unit =>
        Manifest.Unit

//      case byte: java.lang.Byte =>
//        Manifest.Byte
//      case byte: java.lang.Boolean =>
//        Manifest.Boolean
//      case short: java.lang.Short =>
//        Manifest.Short
//      case byte: java.lang.Character =>
//        Manifest.Char
//      case any: java.lang.Integer =>
//        Manifest.Int
//      case long: java.lang.Long =>
//        Manifest.Long
//      case float: java.lang.Float =>
//        Manifest.Float
//      case double: java.lang.Double =>
//        Manifest.Double

      case null =>
        Manifest.Null

      case anyRef: AnyRef =>
        typeOfClass(anyRef.getClass)
    }
  }
}
<commit_msg>Override toString(), equals() for EmptyHint<commit_after>/*
 * Copyright 2011-2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ckkloverdos


package object convert {
  final val EmptyHint: AnyRef = new java.lang.Object {
    override def equals(obj: Any) = obj.asInstanceOf[AnyRef] eq this
    override def toString = "EmptyHint"
  }

  type Type[A] = Manifest[A]

  @inline
  def typeOf[T: Type]: Type[T] = Predef.manifest[T]

  @inline
  def erasureOf[T: Type]: Class[T] = typeOf[T].erasure.asInstanceOf[Class[T]]

  private[convert]
  def typeOfClass[T](clazz: Class[T]): Type[_ <: AnyRef] = {
    if(clazz.isArray) {
      Manifest.arrayType(typeOfClass(clazz.getComponentType))
    } else {
      Manifest.classType(clazz)
    }
  }

  private[convert]
  def typeOfAny[A](any: A): Type[_ <: Any] = {
    any match {
      case byte: Byte =>
        Manifest.Byte
      case byte: Boolean =>
        Manifest.Boolean
      case short: Short =>
        Manifest.Short
      case byte: Char =>
        Manifest.Char
      case any: Int =>
        Manifest.Int
      case long: Long =>
        Manifest.Long
      case float: Float =>
        Manifest.Float
      case double: Double =>
        Manifest.Double
      case unit: Unit =>
        Manifest.Unit

//      case byte: java.lang.Byte =>
//        Manifest.Byte
//      case byte: java.lang.Boolean =>
//        Manifest.Boolean
//      case short: java.lang.Short =>
//        Manifest.Short
//      case byte: java.lang.Character =>
//        Manifest.Char
//      case any: java.lang.Integer =>
//        Manifest.Int
//      case long: java.lang.Long =>
//        Manifest.Long
//      case float: java.lang.Float =>
//        Manifest.Float
//      case double: java.lang.Double =>
//        Manifest.Double

      case null =>
        Manifest.Null

      case anyRef: AnyRef =>
        typeOfClass(anyRef.getClass)
    }
  }
}

{'fraction_non_alphanumeric': 0.11421911421911422, 'fraction_numerical': 0.0050858232676414495, 'mean_word_length': 2.3076384022424667, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 43, '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': '5931397', 'n_tokens_mistral': 1449, 'n_tokens_neox': 1411, 'n_words': 417}