<commit_before>import React from 'react'
import createReactClass from 'create-react-class'
import Autosuggest from 'react-autosuggest'

import bip39String from 'assets/bip39-english.txt'

const bip39 = bip39String.split('\n')

const getSuggestionValue = suggestion => suggestion

// Use your imagination to render suggestions.
const renderSuggestion = suggestion => (
  <div>
    {suggestion}
  </div>
)
const getSuggestions = value => {
  const inputValue = value.trim().toLowerCase()
  const inputLength = inputValue.length

  return inputLength < 3
    ? []
    : bip39.filter(w => w.toLowerCase().slice(0, inputLength) === inputValue
  )
}

const InputWord = createReactClass({
  getInitialState: () => ({
    value: '',
    suggestions: []
  }),

  onChange (event, { newValue }) {
    this.setState({
      value: newValue
    })
  },

  // Autosuggest will call this function every time you need to update suggestions.
  // You already implemented this logic above, so just use it.
  onSuggestionsFetchRequested ({ value }) {
    this.setState({
      suggestions: getSuggestions(value)
    })
  },

  // Autosuggest will call this function every time you need to clear suggestions.
  onSuggestionsClearRequested () {
    this.setState({
      suggestions: []
    })
  },

  render () {
    const inputProps = {
      placeholder: this.props.placeholder,
      value: this.state.value,
      onChange: this.onChange,
      name: this.props.name,
      style: {width: '70px'}
    }
    return (
      <Autosuggest
        className='form-control'
        suggestions={this.state.suggestions}
        onSuggestionsFetchRequested={this.onSuggestionsFetchRequested}
        onSuggestionsClearRequested={this.onSuggestionsClearRequested}
        getSuggestionValue={getSuggestionValue}
        renderSuggestion={renderSuggestion}
        inputProps={inputProps}
        autoCapitalize='none' />
    )
  }
})

export default InputWord<commit_msg>Fix autoCapitalize not working on IOS<commit_after>import React from 'react'
import createReactClass from 'create-react-class'
import Autosuggest from 'react-autosuggest'

import bip39String from 'assets/bip39-english.txt'

const bip39 = bip39String.split('\n')

const getSuggestionValue = suggestion => suggestion

// Use your imagination to render suggestions.
const renderSuggestion = suggestion => (
  <div>
    {suggestion}
  </div>
)
const getSuggestions = value => {
  const inputValue = value.trim().toLowerCase()
  const inputLength = inputValue.length

  return inputLength < 3
    ? []
    : bip39.filter(w => w.toLowerCase().slice(0, inputLength) === inputValue
  )
}

const InputWord = createReactClass({
  getInitialState: () => ({
    value: '',
    suggestions: []
  }),

  onChange (event, { newValue }) {
    this.setState({
      value: newValue
    })
  },

  // Autosuggest will call this function every time you need to update suggestions.
  // You already implemented this logic above, so just use it.
  onSuggestionsFetchRequested ({ value }) {
    this.setState({
      suggestions: getSuggestions(value)
    })
  },

  // Autosuggest will call this function every time you need to clear suggestions.
  onSuggestionsClearRequested () {
    this.setState({
      suggestions: []
    })
  },

  render () {
    const inputProps = {
      placeholder: this.props.placeholder,
      value: this.state.value,
      onChange: this.onChange,
      name: this.props.name,
      autoCapitalize: 'none',
      style: {width: '70px'}
    }
    return (
      <Autosuggest
        className='form-control'
        suggestions={this.state.suggestions}
        onSuggestionsFetchRequested={this.onSuggestionsFetchRequested}
        onSuggestionsClearRequested={this.onSuggestionsClearRequested}
        getSuggestionValue={getSuggestionValue}
        renderSuggestion={renderSuggestion}
        inputProps={inputProps} />
    )
  }
})

export default InputWord
{'fraction_non_alphanumeric': 0.10847371107708015, 'fraction_numerical': 0.0071465033180193975, 'mean_word_length': 3.264417845484222, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '1644770', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1140, 'n_words': 269}