<commit_before>package breeze.text.tokenize

import java.text.BreakIterator

/**
 *
 * @author dlwh
 */

class SentenceTokenizer extends Tokenizer {
  def apply(v1: String): Iterable[String] = {
    new Iterable[String] {
      def iterator: Iterator[String] = new Iterator[String] {
        val it = BreakIterator.getSentenceInstance
        it.setText(v1)
        var start = it.first()
        var end = it.first()
        def hasNext = end >= 0 && end > start || {
          start = end
          end = it.next()
          end != BreakIterator.DONE
        }

        def next(): String = {
          val str = v1.substring(start, end)
          start = end
          str.trim()
        }
      }
    }

  }
}
<commit_msg>make SentenceTokenizer a case class<commit_after>package breeze.text.tokenize

import java.text.BreakIterator

/**
 *
 * @author dlwh
 */

case class SentenceTokenizer() extends Tokenizer {
  def apply(v1: String): Iterable[String] = {
    new Iterable[String] {
      def iterator: Iterator[String] = new Iterator[String] {
        val it = BreakIterator.getSentenceInstance
        it.setText(v1)
        var start = it.first()
        var end = it.first()
        def hasNext = end >= 0 && end > start || {
          start = end
          end = it.next()
          end != BreakIterator.DONE
        }

        def next(): String = {
          val str = v1.substring(start, end)
          start = end
          str.trim()
        }
      }
    }

  }
}
{'fraction_non_alphanumeric': 0.11486486486486487, 'fraction_numerical': 0.005405405405405406, 'mean_word_length': 1.8757281553398057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1890715', 'n_tokens_mistral': 456, 'n_tokens_neox': 446, 'n_words': 111}