<commit_before>import React from 'react';
import InputForm from './InputForm.jsx';
import TextAnalytics from './TextAnalytics.jsx';

export default class TextView extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      visibleAnalytics: false,
      value: '',
    };
  }

  analyzeText = () => {
    this.setState({
      visibleAnalytics: true,
    });
  }

  resetText = () => {
    this.setState({
      visibleAnalytics: false,
      value: '',
    });
  }

  onChange = (e) => {
    this.setState({
      value: e.target.value,
    });
  }


recognition.start();


  render() {
    let recognition = new webkitSpeechRecognition();

    recognition.onresult = function(event) {
        console.log(event);
      }

    let analytics = this.state.visibleAnalytics ? <TextAnalytics text={this.state.value}/> : '';
    return (
      <div>
        <div id='text-input'>
          <h1 id='text-input-title'>Text Analyzer</h1>
          <br/>
          <InputForm text={this.state.value} onChange={this.onChange}/>
          <button onClick={this.analyzeText}>Analyze</button>
          <button onClick={this.resetText}>Reset</button>
          <div>{analytics}</div>
        </div>
      </div>
    );
  }
}
<commit_msg>Remove webkit from textView<commit_after>import React from 'react';
import InputForm from './InputForm.jsx';
import TextAnalytics from './TextAnalytics.jsx';

export default class TextView extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      visibleAnalytics: false,
      value: '',
    };
  }

  analyzeText = () => {
    this.setState({
      visibleAnalytics: true,
    });
  }

  resetText = () => {
    this.setState({
      visibleAnalytics: false,
      value: '',
    });
  }

  onChange = (e) => {
    this.setState({
      value: e.target.value,
    });
  }


recognition.start();


  render() {
    let analytics = this.state.visibleAnalytics ? <TextAnalytics text={this.state.value}/> : '';
    return (
      <div>
        <div id='text-input'>
          <h1 id='text-input-title'>Text Analyzer</h1>
          <br/>
          <InputForm text={this.state.value} onChange={this.onChange}/>
          <button onClick={this.analyzeText}>Analyze</button>
          <button onClick={this.resetText}>Reset</button>
          <div>{analytics}</div>
        </div>
      </div>
    );
  }
}

{'fraction_non_alphanumeric': 0.1570593149540518, 'fraction_numerical': 0.001670843776106934, 'mean_word_length': 2.3875530410183874, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 39, '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': '5191536', 'n_tokens_mistral': 759, 'n_tokens_neox': 752, 'n_words': 136}