<commit_before>package x7c1.wheat.build

import sbt.complete.Parser
import sbt.{Def, PathFinder, State}

object WheatParser {

  import sbt.complete.DefaultParsers._

  lazy val identifier: Parser[String] = {
    val alphabet = token('a' to 'z')
    val numbers = token('0' to '9')
    alphabet.+.string ~ (numbers | alphabet).*.string map {
      case (a, b) => a + b
    }
  }

  def camelizeTail(string: String): Either[WheatParserError, String] = {
    val parser = (identifier ~ (token('_') ~> identifier).*) map {
      case (head, tail) => head + tail.map(_.capitalize).mkString
    }
    parse(string, parser).left.map(WheatParserError)
  }

  def selectFrom(finder: PathFinder): Def.Initialize[State => Parser[Seq[String]]] =
    Def.setting { state =>
      val names = finder.get.map(_.getName)
      ReductiveParser from names
    }

}

case class WheatParserError(message: String)
<commit_msg>remove private layouts from tab completions<commit_after>package x7c1.wheat.build

import sbt.complete.Parser
import sbt.{Def, PathFinder, State}

object WheatParser {

  import sbt.complete.DefaultParsers._

  lazy val identifier: Parser[String] = {
    val alphabet = token('a' to 'z')
    val numbers = token('0' to '9')
    alphabet.+.string ~ (numbers | alphabet).*.string map {
      case (a, b) => a + b
    }
  }

  def camelizeTail(string: String): Either[WheatParserError, String] = {
    val parser = (identifier ~ (token('_') ~> identifier).*) map {
      case (head, tail) => head + tail.map(_.capitalize).mkString
    }
    parse(string, parser).left.map(WheatParserError)
  }

  def selectFrom(finder: PathFinder): Def.Initialize[State => Parser[Seq[String]]] =
    Def.setting { state =>
      val names = finder.get.map(_.getName) filterNot (_ startsWith "_")
      ReductiveParser from names
    }

}

case class WheatParserError(message: String)

{'fraction_non_alphanumeric': 0.1378941742383752, 'fraction_numerical': 0.00427578834847675, 'mean_word_length': 3.5217391304347827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5830387', 'n_tokens_mistral': 629, 'n_tokens_neox': 609, 'n_words': 147}