<commit_before>const React = require('react');
const createClass = require('create-react-class');
const _     = require('lodash');
const cx    = require('classnames');

const ErrorBar = createClass({
	getDefaultProps : function() {
		return {
			errors : []
		};
	},

	hasOpenError  : false,
	hasCloseError : false,
	hasMatchError : false,

	renderErrors : function(){
		this.hasOpenError = false;
		this.hasCloseError = false;
		this.hasMatchError = false;


		const errors = _.map(this.props.errors, (err, idx)=>{
			if(err.id == 'OPEN') this.hasOpenError = true;
			if(err.id == 'CLOSE') this.hasCloseError = true;
			if(err.id == 'MISMATCH') this.hasMatchError = true;
			return <li key={idx}>
				Line {err.line} : {err.text}, '{err.type}' tag
			</li>;
		});

		return <ul>{errors}</ul>;
	},

	renderProtip : function(){
		const msg = [];
		if(this.hasOpenError){
			msg.push(<div>
				An unmatched opening tag means there's an opened tag that isn't closed, you need to close a tag, like this {'</div>'}. Make sure to match types!
			</div>);
		}

		if(this.hasCloseError){
			msg.push(<div>
				An unmatched closing tag means you closed a tag without opening it. Either remove it, you check to where you think you opened it.
			</div>);
		}

		if(this.hasMatchError){
			msg.push(<div>
				A type mismatch means you closed a tag, but the last open tag was a different type.<commit_msg>minor grammar fixes in error messages<commit_after>const React = require('react');
const createClass = require('create-react-class');
const _     = require('lodash');
const cx    = require('classnames');

const ErrorBar = createClass({
	getDefaultProps : function() {
		return {
			errors : []
		};
	},

	hasOpenError  : false,
	hasCloseError : false,
	hasMatchError : false,

	renderErrors : function(){
		this.hasOpenError = false;
		this.hasCloseError = false;
		this.hasMatchError = false;


		const errors = _.map(this.props.errors, (err, idx)=>{
			if(err.id == 'OPEN') this.hasOpenError = true;
			if(err.id == 'CLOSE') this.hasCloseError = true;
			if(err.id == 'MISMATCH') this.hasMatchError = true;
			return <li key={idx}>
				Line {err.line} : {err.text}, '{err.type}' tag
			</li>;
		});

		return <ul>{errors}</ul>;
	},

	renderProtip : function(){
		const msg = [];
		if(this.hasOpenError){
			msg.push(<div>
				An unmatched opening tag means there's an opened tag that isn't closed. You need to close your tags, like this {'</div>'}. Make sure to match types!
			</div>);
		}

		if(this.hasCloseError){
			msg.push(<div>
				An unmatched closing tag means you closed a tag without opening it. Either remove it, or check to where you think you opened it.
			</div>);
		}

		if(this.hasMatchError){
			msg.push(<div>
				A type mismatch means you closed a tag, but the last open tag was a different type.
{'fraction_non_alphanumeric': 0.14372109569548203, 'fraction_numerical': 0.0, 'mean_word_length': 3.528180354267311, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '669951', 'n_tokens_mistral': 1032, 'n_tokens_neox': 902, 'n_words': 282}