<commit_before>package pl.writeonly.son2.drop.vaadin.complexes

import com.jayway.jsonpath.{Option => jOption}
import com.vaadin.ui.Component
import pl.writeonly.son2.drop.vaadin.util.UITrait

class ComplexPathOptions extends Complex {
  private val component = ComplexPathOptions.apply

  override def toComponent: Component = component

  def selectedItem = ComplexPathOptions.selectedItem(component, ComplexPathOptions.mapping)
}

object ComplexPathOptions extends UITrait {
  private val mapping = Map[String, Symbol](
    "As path list" -> toSymbol(jOption.AS_PATH_LIST),
    "Always return list" -> toSymbol(jOption.ALWAYS_RETURN_LIST),
    "default path leaf to null" -> toSymbol(jOption.DEFAULT_PATH_LEAF_TO_NULL),
    "requite properties" -> toSymbol(jOption.REQUIRE_PROPERTIES),
    "suppress exception" -> toSymbol(jOption.SUPPRESS_EXCEPTIONS))

  private def toSymbol(option: jOption) = Symbol(option.name())

  private def apply = checkBoxGroup("Path options:", ComplexPathOptions.mapping)
}<commit_msg>ComplexPathOptions<commit_after>package pl.writeonly.son2.drop.vaadin.complexes

import com.jayway.jsonpath.{Option => jOption}
import com.vaadin.ui.Component
import pl.writeonly.son2.drop.vaadin.util.{ItemSymbol, UITrait}

class ComplexPathOptions extends Complex {
  private val component = ComplexPathOptions.apply

  override def toComponent: Component = component

  def selectedItem = ComplexPathOptions.selectedItem2(component).map(_.value)
}

object ComplexPathOptions extends UITrait {
  private val items = Set[ItemSymbol](
    ItemSymbol(toSymbol(jOption.AS_PATH_LIST), "As path list"),
    ItemSymbol(toSymbol(jOption.ALWAYS_RETURN_LIST), "Always return list"),
    ItemSymbol(toSymbol(jOption.DEFAULT_PATH_LEAF_TO_NULL), "default path leaf to null"),
    ItemSymbol(toSymbol(jOption.REQUIRE_PROPERTIES), "requite properties"),
    ItemSymbol(toSymbol(jOption.SUPPRESS_EXCEPTIONS), "suppress exception")
  )

  private def toSymbol(option: jOption) = Symbol(option.name())

  private def apply = checkBoxGroup2("Path options:", items)
}
{'fraction_non_alphanumeric': 0.10077519379844961, 'fraction_numerical': 0.0029069767441860465, 'mean_word_length': 5.952861952861953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '6545652', 'n_tokens_mistral': 633, 'n_tokens_neox': 607, 'n_words': 131}