<commit_before>  /** @jsx createElement */
import {createElement} from 'elliptical'

const defaultProps = {
  label: 'string',
  limit: 1,
  trimmed: true
}

function describe ({props}) {
  return (
    <placeholder
      label={props.label}
      arguments={props.phraseArguments || (props.phraseArguments ? [props.phraseArgument] : [props.label])}>
      <freetext
        greedy={props.greedy}
        consumeAll={props.consumeAll}
        splitOn={props.splitOn}
        trimmed={props.trimmed}
        filter={(input) => filter(input, props)}
        limit={props.limit} />
    </placeholder>
  )
}

function filter (input, props) {
  if (props.trimmed && (/^\s/.test(input) || /\s$/.test(input))) {
    return false
  }

  if (props.filter) {
    return props.filter(input)
  }

  return true
}

export const String = {defaultProps, describe}<commit_msg>Add id to make Lacona extension easier<commit_after>  /** @jsx createElement */
import {createElement} from 'elliptical'

const defaultProps = {
  label: 'string',
  limit: 1,
  trimmed: true
}

function describe ({props}) {
  return (
    <placeholder
      label={props.label}
      arguments={props.phraseArguments || (props.phraseArguments ? [props.phraseArgument] : [props.label])}>
      <freetext
        greedy={props.greedy}
        consumeAll={props.consumeAll}
        splitOn={props.splitOn}
        trimmed={props.trimmed}
        filter={(input) => filter(input, props)}
        limit={props.limit} />
    </placeholder>
  )
}

function filter (input, props) {
  if (props.trimmed && (/^\s/.test(input) || /\s$/.test(input))) {
    return false
  }

  if (props.filter) {
    return props.filter(input)
  }

  return true
}

export const String = {defaultProps, describe, id: 'elliptical-string:String'}
{'fraction_non_alphanumeric': 0.15194147439504782, 'fraction_numerical': 0.0011254924029262803, 'mean_word_length': 3.096774193548387, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '5849257', 'n_tokens_mistral': 571, 'n_tokens_neox': 561, 'n_words': 119}