<commit_before>#include <iostream>
#include <string>
#include "Line.h"
#include "main.h"

using namespace std;

/************************
 *	Purpose / what it does
 *		Converts the given string and sets it to the object's 'line' character array
 *	
 *	Parameters
 *		string a_charArray		The line to be set
 ************************/
void Line::setLine(std::string a_newLine, bool a_getWords)
{
	numChars	= a_newLine.size();
	a_newLine.copy(line, numChars);

	if(a_getWords)
		getWords();
}


/************************
 *	Purpose / what it does
 *		Splits the line object up into an array of words (delimitered by spaces)
 ************************/
void Line::getWords()
{
	// Used when testing characters from other arrays for a space-bar
	char space	= ' ';
	char tab	= '	';

	// Initialise the vairables we'll be using to locate words
	numWords	= 0;
	char thisWord[1024];
	int charCounter	= 0;

	for(int i=0; i<numChars; ++i)
	{
		// If this character in 'line' is a space or if we're at the end of the 'line' array, add word to the array of words
		if(line[i] == space || i == numChars - 1)
		{
			if(i == numChars - 1)<commit_msg>fixed small derp with setting the number of chars<commit_after>#include <iostream>
#include <string>
#include "Line.h"
#include "main.h"

using namespace std;

/************************
 *	Purpose / what it does
 *		Converts the given string and sets it to the object's 'line' character array
 *	
 *	Parameters
 *		string a_charArray		The line to be set
 ************************/
void Line::setLine(std::string a_newLine, bool a_getWords)
{
	if(a_newLine[0] == 0 && a_newLine.size() == 1)
		numChars	= 0;
	else
		numChars	= a_newLine.size();
	a_newLine.copy(line, numChars);

	if(a_getWords)
		getWords();
}


/************************
 *	Purpose / what it does
 *		Splits the line object up into an array of words (delimitered by spaces)
 ************************/
void Line::getWords()
{
	// Used when testing characters from other arrays for a space-bar
	char space	= ' ';
	char tab	= '	';

	// Initialise the vairables we'll be using to locate words
	numWords	= 0;
	char thisWord[1024];
	int charCounter	= 0;

	for(int i=0; i<numChars; ++i)
	{
		// If this character in 'line' is a space or if we're at the end of the 'line' array, add word to the array of words
		if(line[i] == space || i == numChars - 1)
		{
			if(i == numChars - 1)
{'fraction_non_alphanumeric': 0.18836915297092288, 'fraction_numerical': 0.009270965023177412, 'mean_word_length': 3.8647540983606556, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1252147', 'n_tokens_mistral': 880, 'n_tokens_neox': 797, 'n_words': 280}