<commit_before>package sma.digging

import akka.actor.Props
import org.apache.kafka.clients.producer.ProducerRecord
import sma.eventsourcing.{Committing, Particle}
import sma.json.Json

object Digger {
  def props(): Props = {
    Props(classOf[Digger])
  }
}

class Digger extends Particle with Committing {

  override def receive = {
    case message: Digging =>
      sender() ! DiggingReply()

      commit(message, digTopic(message.user, message.network))

      logReceiving(message.mkString)
  }

  def commit(message: Digging, topic: String) = {
    producer.send(diggingProducerRecord(message, topic))
  }

  private def diggingProducerRecord(dig: Digging, topic: String) = {
    val key = Json.encode(dig.key)
    val value = Json.encode(dig)
    new ProducerRecord[Array[Byte], Array[Byte]](topic, key, value)
  }

}
<commit_msg>small Digger actor refactoring<commit_after>package sma.digging

import akka.actor.Props
import org.apache.kafka.clients.producer.ProducerRecord
import sma.eventsourcing.{Committing, Particle}
import sma.json.Json

object Digger {
  def props(): Props = Props(classOf[Digger])
}

class Digger extends Particle with Committing {

  override def receive = {
    case digging: Digging =>
      logReceiving(digging.mkString)
      sender() ! DiggingReply()
      commit(digging, digTopic(digging.user, digging.network))
  }

  def commit(message: Digging, topic: String) = producer.send(diggingProducerRecord(message, topic))

  private def diggingProducerRecord(dig: Digging, topic: String) = {
    val key = Json.encode(dig.key)
    val value = Json.encode(dig)
    new ProducerRecord[Array[Byte], Array[Byte]](topic, key, value)
  }

}

{'fraction_non_alphanumeric': 0.11210494931425163, 'fraction_numerical': 0.0, 'mean_word_length': 4.310126582278481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3616640', 'n_tokens_mistral': 550, 'n_tokens_neox': 537, 'n_words': 121}