<commit_before>#include <iostream>
#include <string>

using namespace std;

/*
˼·
*/
enum ENState
{
	START,		// ʼ
	INTEGER,	// 
	FLOAT,		// С
	SCIENCE,	// ѧ
	END,		// β
	ERROR		// 
};
class Solution {
public:
	bool isNumber(string s) {
		ENState state = START;
		bool bIsNumeric = false;
		for (size_t i = 0; i < s.length(); ++i)
		{
			switch (state)
			{
			case START:
				if (s[i] >= 48 && s[i] <= 57)
				{
					state = INTEGER;
					bIsNumeric = true;
				}
				else if (s[i] == '+' || s[i] == '-' || s[i] == ' ')
				{

				}
				else
				{
					state = ERROR;
				}
				break;
			case INTEGER:
				if (s[i] >= 48 && s[i] <= 57)
				{

				}
				else if (s[i] == '.')
				{
					state = FLOAT;
					bIsNumeric = false;
				}
				else if (s[i] == 'e')
				{
					state = SCIENCE;
					bIsNumeric = false;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\n')
				{
					state = END;
				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
					i = s.length();
				}
				break;
			case FLOAT:
				if (s[i] >= 48 && s[i] <= 57)
				{
					bIsNumeric = true;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\n')
				{
					state = END;
				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
					i = s.length();
				}
				break;
			case SCIENCE:
				if (s[i] >= 48 && s[i] <= 57)
				{
					bIsNumeric = true;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\n')
				{
					state = END;
				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
					i = s.length();
				}
				break;
			case END:
				if (s[i] == ' ' || s[i] == '\t' || s[i] == '\t')
				{

				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
					i = s.length();
				}<commit_msg>complete valid number<commit_after>#include <iostream>
#include <string>

using namespace std;

/*
˼·
״̬ʵ֣ͬͶӦͬ״̬
ǰԼ˼·ʵ֮ȴûACΪ.1ҵ˼·ԷfalseǴȴ˵true
Ҿ.1ôˣ

20εsubmitACˡ
*/
enum ENState
{
	INIT,		// ʼ
	START,		// ʼ
	INTEGER,	// 
	FLOAT,		// С
	SCIENCE,	// ѧ
	INDEX,		// ָ
	END,		// β
	ERROR		// 
};
class Solution {
public:
	bool isNumber(string s) {
		ENState state = INIT;
		bool bIsNumeric = false;
		for (size_t i = 0; i < s.length(); ++i)
		{
			switch (state)
			{
			case INIT:
				if (s[i] >= 48 && s[i] <= 57)
				{ // 
					state = INTEGER;
					bIsNumeric = true;
				}
				else if (s[i] == '+' || s[i] == '-')
				{ // ʼ
					state = START;
					bIsNumeric = false;
				}
				else if (s[i] == '.')
				{ // 
					state = FLOAT;
					bIsNumeric = false;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\n')
				{ // ǳʼ
					state = INIT;
					bIsNumeric = false;
				}
				else
				{ // 
					state = ERROR;
					bIsNumeric = false;
				}
				break;
			case START:
				if (s[i] >= 48 && s[i] <= 57)
				{
					state = INTEGER;
					bIsNumeric = true;
				}
				else if (s[i] == '.')
				{
					state = FLOAT;
					bIsNumeric = false;
				}
				else
				{
					state = ERROR;
				}
				break;
			case INTEGER:
				if (s[i] >= 48 && s[i] <= 57)
				{
					state = INTEGER;
					bIsNumeric = true;
				}
				else if (s[i] == '.')
				{
					state = FLOAT;
					bIsNumeric = true;
				}
				else if (s[i] == 'e')
				{
					state = SCIENCE;
					bIsNumeric = false;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\n')
				{
					state = END;
				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
					i = s.length();
				}
				break;
			case FLOAT:
				if (s[i] >= 48 && s[i] <= 57)
				{
					state = FLOAT;
					bIsNumeric = true;
				}
				else if (bIsNumeric && s[i] == 'e')
				{
					state = SCIENCE;
					bIsNumeric = false;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\n')
				{
					state = END;
				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
					i = s.length();
				}
				break;
			case SCIENCE:
				if (s[i] >= 48 && s[i] <= 57)
				{
					state = INDEX;
					bIsNumeric = true;
				}
				else if (s[i] == '+' || s[i] == '-')
				{
					state = INDEX;
					bIsNumeric = false;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\t')
				{
					state = END;
					bIsNumeric = false;
				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
				}
				break;
			case INDEX:
				if (s[i] >= 48 && s[i] <= 57)
				{
					state = INDEX;
					bIsNumeric = true;
				}
				else if (s[i] == ' ' || s[i] == '\t' || s[i] == '\t')
				{
					state = END;
				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
				}
				break;
			case END:
				if (s[i] == ' ' || s[i] == '\t' || s[i] == '\t')
				{

				}
				else
				{
					state = ERROR;
					bIsNumeric = false;
					i = s.length();
				}
{'fraction_non_alphanumeric': 0.20138738348146543, 'fraction_numerical': 0.009971818773032734, 'mean_word_length': 1.471344402785217, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '3295282', 'n_tokens_mistral': 2831, 'n_tokens_neox': 2027, 'n_words': 438}