<commit_before>package org.talkingpuffin.time

/**
 * Time formatter
 */
case class TimeFormatter(time: Long) {
  val days = time / 86400
  val hours = (time / 3600) - (days * 24)
  val minutes = (time / 60) - (days * 1440) - (hours * 60)
  val seconds = time % 60
  
  def colonSeparated: String = {
    val sb = new StringBuilder
    if (days > 0)                      sb.append(twoDigitNum(days))    .append(":")
    if (hours > 0    || sb.length > 0) sb.append(twoDigitNum(hours))   .append(":")
    if (minutes > 0  || sb.length > 0) sb.append(twoDigitNum(minutes)) .append(":")
    sb.append(twoDigitNum(seconds))
    sb.toString
  }
  
  def longForm: String = {
    val sb = new StringBuilder
    addPart(sb, days,    "d")
    addPart(sb, hours,   "h")
    addPart(sb, minutes, "m")
    addPart(sb, seconds, "s")
    
    def addPart(sb: StringBuilder, value: Long, name: String): Unit = {
      if (value > 0) {
        if (sb.length > 0) sb.append(' ')
        sb.append(value).append(' ').append(name)
      }
    }
    
    sb.toString
  }
  
  private def twoDigitNum(num: java.lang.Long) = String.format("%02d", num)
  
}<commit_msg>Put the time formatting back the way it was (mins, secs, etc.)<commit_after>package org.talkingpuffin.time

/**
 * Time formatter
 */
case class TimeFormatter(time: Long) {
  val days = time / 86400
  val hours = (time / 3600) - (days * 24)
  val minutes = (time / 60) - (days * 1440) - (hours * 60)
  val seconds = time % 60
  
  def colonSeparated: String = {
    val sb = new StringBuilder
    if (days > 0)                      sb.append(twoDigitNum(days))    .append(":")
    if (hours > 0    || sb.length > 0) sb.append(twoDigitNum(hours))   .append(":")
    if (minutes > 0  || sb.length > 0) sb.append(twoDigitNum(minutes)) .append(":")
    sb.append(twoDigitNum(seconds))
    sb.toString
  }
  
  def longForm: String = {
    val sb = new StringBuilder
    addPart(sb, days,    "day")
    addPart(sb, hours,   "hour")
    addPart(sb, minutes, "min")
    addPart(sb, seconds, "sec")
    
    def addPart(sb: StringBuilder, value: Long, name: String): Unit = {
      if (value > 0) {
        if (sb.length > 0) sb.append(' ')
        sb.append(value).append(' ').append(name)
        if (value > 1) sb.append('s')
      }
    }
    
    sb.toString
  }
  
  private def twoDigitNum(num: java.lang.Long) = String.format("%02d", num)
  
}
{'fraction_non_alphanumeric': 0.15606694560669457, 'fraction_numerical': 0.025523012552301255, 'mean_word_length': 2.4402877697841725, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 18, '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': '5527161', 'n_tokens_mistral': 910, 'n_tokens_neox': 842, 'n_words': 217}