<commit_before>package sample.stream

import akka.actor.ActorSystem
import akka.stream.MaterializerSettings
import akka.stream.scaladsl2._

object BasicTransformation {

  def main(args: Array[String]): Unit = {
    implicit val system = ActorSystem("Sys")
    import system.dispatcher

    implicit val materializer = FlowMaterializer()

    val text =
      """|Lorem Ipsum is simply dummy text of the printing and typesetting industry.
         |Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
         |when an unknown printer took a galley of type and scrambled it to make a type 
         |specimen book.""".stripMargin

    Source(text.split("\\s").iterator).
      map(_.toUpperCase).
      runWith(ForeachDrain(println)).
      onComplete(_ => system.shutdown())

    // could also use .foreach(println) instead of .runWith(ForeachDrain(println)) above
    // as it is shorthand for the same thing
  }
}
<commit_msg>Switched to simpler foreach(println) form for default in BasicTransformation.<commit_after>package sample.stream

import akka.actor.ActorSystem
import akka.stream.MaterializerSettings
import akka.stream.scaladsl2._

object BasicTransformation {

  def main(args: Array[String]): Unit = {
    implicit val system = ActorSystem("Sys")
    import system.dispatcher

    implicit val materializer = FlowMaterializer()

    val text =
      """|Lorem Ipsum is simply dummy text of the printing and typesetting industry.
         |Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
         |when an unknown printer took a galley of type and scrambled it to make a type 
         |specimen book.""".stripMargin

    Source(text.split("\\s").iterator).
      map(_.toUpperCase).
      foreach(println).
      onComplete(_ => system.shutdown())

    // could also use .runWith(ForeachDrain(println)) instead of .foreach(println) above
    // as it is shorthand for the same thing. Drains may be constructed elsewhere and plugged
    // in like this. Note also that foreach returns a future (in either form) which may be
    // used to attach lifecycle events to, like here with the onComplete.
  }
}

{'fraction_non_alphanumeric': 0.08409926470588236, 'fraction_numerical': 0.004595588235294118, 'mean_word_length': 3.345309381237525, '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': '7483418', 'n_tokens_mistral': 615, 'n_tokens_neox': 583, 'n_words': 222}