<commit_before>#include <memory>

namespace ouroboros
{
	template<class T>
	group<T>::group(const std::string& aTitle, const std::string& aDescription)
	:base_field(aTitle, aDescription)
	{}
	
	template<class T>
	void group<T>::add(T *apField)
	{
		//FIXME What if it is null?
		mItems[apField->getTitle()] = apField;
	}
	
	template<class T>
	void group<T>::add(group<T> *apField)
	{
		//FIXME what if it is null?
		mGroups[apField->getTitle()] = apField;<commit_msg>Changed the key of the maps for fields and groups to use a copy of the title that has been converted to a lower case string with no spaces. Spaces are replaced with an underscore _. This relieves having to worry about casing and spacing of group and variable titles when accessing them through the REST api.<commit_after>#include <memory>
#include <algorithm>

namespace ouroboros
{
	template<class T>
	group<T>::group(const std::string& aTitle, const std::string& aDescription)
	:base_field(aTitle, aDescription)
	{}
	
	template<class T>
	void group<T>::add(T *apField)
	{
		//FIXME What if it is null?
		//Create a new string for lookup purposes with all lower case letters and no spaces
		std::string lookupTitle = apField->getTitle();
		std::transform(lookupTitle.begin(), lookupTitle.end(), lookupTitle.begin(), ::tolower);
		std::replace(lookupTitle.begin(), lookupTitle.end(), ' ', '_');
		mItems[lookupTitle] = apField;
	}
	
	template<class T>
	void group<T>::add(group<T> *apField)
	{
		//FIXME what if it is null?
		//Create a new string for lookup purposes with all lower case letters and no spaces
		std::string lookupTitle = apField->getTitle();
		std::transform(lookupTitle.begin(), lookupTitle.end(), lookupTitle.begin(), ::tolower);
		std::replace(lookupTitle.begin(), lookupTitle.end(), ' ', '_');
		mGroups[lookupTitle] = apField;
{'fraction_non_alphanumeric': 0.13112947658402205, 'fraction_numerical': 0.0, 'mean_word_length': 5.053333333333334, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 24, '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': '3902019', 'n_tokens_mistral': 593, 'n_tokens_neox': 565, 'n_words': 184}