<commit_before>package viscel.shared

import java.net.URL
import java.time.Instant
//import io.lemonlabs.uri.AbsoluteUrl

import viscel.shared.DataRow._

final class Vurl private (private val uri: String) extends AnyVal {
  def uriString(): String       = uri
  override def toString: String = s"Vurl(${uriString()})"
}

object Vurl {

  def apply(s: String): Vurl = fromString(s)

  /* Ensure urls are always parsed. */
  implicit def fromString(uri: String): Vurl = {
    if (uri.startsWith("viscel:")) new Vurl(uri)
    else new Vurl(new URL(uri).toString)
  }

  /* Ensure urls are always parsed. */
  def unsafeFromString(uri: String): Vurl = {
    new Vurl(uri)
  }
}

final case class DataRow(
    ref: Vurl,
    loc: Option[Vurl] = None,
    lastModified: Option[Instant] = None,
    etag: Option[String] = None,
    contents: List[Content]
) {
  def updates(other: DataRow): Boolean = {
    contents != other.contents
  }

}

object DataRow {
  sealed trait Content
  final case class Link(ref: Vurl, data: List[String] = Nil) extends Content
  final case class Blob(sha1: String, mime: String)          extends Content
  final case class Chapter(name: String)                     extends Content
}
<commit_msg>remove incorrect comment<commit_after>package viscel.shared

import java.net.URL
import java.time.Instant
//import io.lemonlabs.uri.AbsoluteUrl

import viscel.shared.DataRow._

final class Vurl private (private val uri: String) extends AnyVal {
  def uriString(): String       = uri
  override def toString: String = s"Vurl(${uriString()})"
}

object Vurl {

  def apply(s: String): Vurl = fromString(s)

  /* Ensure urls are always parsed. */
  implicit def fromString(uri: String): Vurl = {
    if (uri.startsWith("viscel:")) new Vurl(uri)
    else new Vurl(new URL(uri).toString)
  }

  def unsafeFromString(uri: String): Vurl = {
    new Vurl(uri)
  }
}

final case class DataRow(
    ref: Vurl,
    loc: Option[Vurl] = None,
    lastModified: Option[Instant] = None,
    etag: Option[String] = None,
    contents: List[Content]
) {
  def updates(other: DataRow): Boolean = {
    contents != other.contents
  }

}

object DataRow {
  sealed trait Content
  final case class Link(ref: Vurl, data: List[String] = Nil) extends Content
  final case class Blob(sha1: String, mime: String)          extends Content
  final case class Chapter(name: String)                     extends Content
}

{'fraction_non_alphanumeric': 0.11235489220563848, 'fraction_numerical': 0.0008291873963515755, 'mean_word_length': 3.3477477477477477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5391119', 'n_tokens_mistral': 778, 'n_tokens_neox': 782, 'n_words': 235}