<commit_before>import React from 'react';
import $ from 'jquery';
import { Row, Col } from 'react-bootstrap';

export default class WordsToAvoid extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      word: '',
    };
  }

  handleChange(e) {
    this.setState({
      word: e.target.value,
    });
  }

  addWord() {
    this.props.addWordsToAvoid(this.state.word);
    $('.avoid').append(`<p id='${this.state.word}'>${this.state.word}</p>`);
    this.setState({
      word: '',
    });
  }

  handleClick() {
    this.props.removeWordsFromAvoid();
    $('.avoid').children().remove();
  }

  render() {
    const addWord = this.addWord.bind(this);
    const handleClear = this.handleClick.bind(this);
    const handleInputChange = this.handleChange.bind(this);<commit_msg>Add preventDefault upon word submission to prevent unintended page refresh<commit_after>import React from 'react';
import $ from 'jquery';
import { Row, Col } from 'react-bootstrap';

export default class WordsToAvoid extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      word: '',
    };
  }

  handleChange(e) {
    this.setState({
      word: e.target.value,
    });
  }

  addWord(e) {
    e.preventDefault();
    this.props.addWordsToAvoid(this.state.word);
    $('.avoid').append(`<p id='${this.state.word}'>${this.state.word}</p>`);
    this.setState({
      word: '',
    });
  }

  handleClick() {
    this.props.removeWordsFromAvoid();
    $('.avoid').children().remove();
  }

  render() {
    const addWord = this.addWord.bind(this);
    const handleClear = this.handleClick.bind(this);
    const handleInputChange = this.handleChange.bind(this);
{'fraction_non_alphanumeric': 0.16998827667057445, 'fraction_numerical': 0.0, 'mean_word_length': 3.246268656716418, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1988969', 'n_tokens_mistral': 563, 'n_tokens_neox': 547, 'n_words': 99}