<commit_before>package org.wandledi.scala

import org.xml.sax.Attributes
import org.wandledi.Attribute
import org.wandledi.Scroll
import org.wandledi.Selector
import org.wandledi.Spell
import org.wandledi.ElementForeachImpl
import org.wandledi.Plan
import org.wandledi.spells.InsertionIntent
import org.wandledi.spells.ReplacementIntent
import org.wandledi.spells.StringTransformation
import org.wandledi.spells.TransformedAttribute

class ElementImpl(
  aSelector: Selector,
  aScroll: Scroll)
extends org.wandledi.ElementImpl(aSelector, aScroll) with Element {

  def text_=(value: String) {
    text.setContent(value)
  }
  def text: TextContent = new TextContentImpl(this)

  def foreachIn[T: ClassManifest](items: Iterable[T], reduceBefore: Boolean = false)(fun: (SelectableElement, T) => Unit) {
    import collection.JavaConversions._
    val plan = new Plan[T] {
      def execute(e: org.wandledi.SelectableElement, item: T): Unit =
        fun(new SelectableElementImpl(e.getSelector, e.getScroll, e.getScroll), item)
    }
    val foreach = new ElementForeachImpl(this, items, reduceBefore)
    foreach.apply(plan)
  }

  def foreachWithIndexIn[T: ClassManifest](items: Iterable[T], reduceBefore: Boolean = false)
      (fun: (SelectableElement, T, Int) => Unit) {
    import collection.JavaConversions._
    val plan = new Plan[T] {
      def execute(e: org.wandledi.SelectableElement, item: T): Unit =
        fun(new SelectableElementImpl(e.getSelector, e.getScroll, e.getScroll), item, index)
    }
    val foreach = new ElementForeachImpl(this, items, reduceBefore)<commit_msg>shortened line<commit_after>package org.wandledi.scala

import org.xml.sax.Attributes
import org.wandledi.Attribute
import org.wandledi.Scroll
import org.wandledi.Selector
import org.wandledi.Spell
import org.wandledi.ElementForeachImpl
import org.wandledi.Plan
import org.wandledi.spells.InsertionIntent
import org.wandledi.spells.ReplacementIntent
import org.wandledi.spells.StringTransformation
import org.wandledi.spells.TransformedAttribute

class ElementImpl(
  aSelector: Selector,
  aScroll: Scroll)
extends org.wandledi.ElementImpl(aSelector, aScroll) with Element {

  def text_=(value: String) {
    text.setContent(value)
  }
  def text: TextContent = new TextContentImpl(this)

  def foreachIn[T: ClassManifest](items: Iterable[T], reduceBefore: Boolean = false)
      (fun: (SelectableElement, T) => Unit) {
    import collection.JavaConversions._
    val plan = new Plan[T] {
      def execute(e: org.wandledi.SelectableElement, item: T): Unit =
        fun(new SelectableElementImpl(e.getSelector, e.getScroll, e.getScroll), item)
    }
    val foreach = new ElementForeachImpl(this, items, reduceBefore)
    foreach.apply(plan)
  }

  def foreachWithIndexIn[T: ClassManifest](items: Iterable[T], reduceBefore: Boolean = false)
      (fun: (SelectableElement, T, Int) => Unit) {
    import collection.JavaConversions._
    val plan = new Plan[T] {
      def execute(e: org.wandledi.SelectableElement, item: T): Unit =
        fun(new SelectableElementImpl(e.getSelector, e.getScroll, e.getScroll), item, index)
    }
    val foreach = new ElementForeachImpl(this, items, reduceBefore)
{'fraction_non_alphanumeric': 0.10275689223057644, 'fraction_numerical': 0.0, 'mean_word_length': 4.691622103386809, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1563048', 'n_tokens_mistral': 1012, 'n_tokens_neox': 1034, 'n_words': 229}