<commit_before>include Comparator/Comparator.sh
include String/Validator/StringValidator.sh

StringUtil(){
	capitalize(){
		local str=${1}

		echo ${str^}
	}

	replace(){
		local str=${1}
		local orig=${2}
		local new=${3}

		if [[ $(Comparator isEqual ${orig} space) ]]; then
			orig=" "
		fi

		if [[ $(Comparator isEqual ${new} space) ]]; then
			new=" "
		fi

		echo ${str//${orig}/${new}}
	}

	returnOption(){
		local opt=${1}

		if [[ $(StringValidator isSubstring ${opt} -) ]]; then
			local isValidOpt=$(StringValidator isAlphaNum $(strip ${opt} -))
		fi

		if [[ ${isValidOpt} ]]; then
			strip ${opt} -
		fi
	}

	strip(){
		replace ${1} ${2}
	}

	toLowerCase(){
		local str=${1}

		echo ${str,,}
	}

	toUpperCase(){
		local str=${1}

		echo ${str^^}
	}

	$@
}<commit_msg>These StringUtil functions need to take in all possible arguments<commit_after>include Comparator/Comparator.sh
include String/Validator/StringValidator.sh

StringUtil(){
	capitalize(){
		local str=${@}

		echo ${str^}
	}

	replace(){
		local str=${1}
		local orig=${2}
		local new=${3}

		if [[ $(Comparator isEqual ${orig} space) ]]; then
			orig=" "
		fi

		if [[ $(Comparator isEqual ${new} space) ]]; then
			new=" "
		fi

		echo ${str//${orig}/${new}}
	}

	returnOption(){
		local opt=${1}

		if [[ $(StringValidator isSubstring ${opt} -) ]]; then
			local isValidOpt=$(StringValidator isAlphaNum $(strip ${opt} -))
		fi

		if [[ ${isValidOpt} ]]; then
			strip ${opt} -
		fi
	}

	strip(){
		replace ${1} ${2}
	}

	toLowerCase(){
		local str=${@}

		echo ${str,,}
	}

	toUpperCase(){
		local str=${@}

		echo ${str^^}
	}

	$@
}
{'fraction_non_alphanumeric': 0.201363073110285, 'fraction_numerical': 0.00929368029739777, 'mean_word_length': 3.364864864864865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '324661', 'n_tokens_mistral': 661, 'n_tokens_neox': 585, 'n_words': 147}