<commit_before><?php

	/**
	 * Various useful text formatting functions
	 * I guess generally these will be static functions
	 *
	 * @author <NAME> <<EMAIL>>,
	 *         <NAME> <<EMAIL>>
	 * @license https://github.com/Asgrim/MAL/raw/master/LICENSE The BSD License
	 * @copyright Copyright (c) 2011, James Titcumb
	 */
	class MAL_Util_TextFormatting
	{
		/**
		 * Generate a slug based on arbitrary text
		 *
		 * @author <NAME> <<EMAIL>>
		 *
		 * @param string $value The arbitrary text to slug-ify
		 * @return string
		 */
		public static function MakeSlug($value)
		{
			$slug = strtolower($value);
			$slug = preg_replace("/[^a-zA-Z0-9\s]/", "", $slug);
			$slug = trim($slug);
			$slug = preg_replace("/[\s+^$]/", "-", $slug);

			return $slug;
		}
	}
<commit_msg>Added a simple UnmakeSlug function to TextFormatting.<commit_after><?php

	/**
	 * Various useful text formatting functions
	 * I guess generally these will be static functions
	 *
	 * @author James Titcumb <<EMAIL>>,
	 *         <NAME> <<EMAIL>>
	 * @license https://github.com/Asgrim/MAL/raw/master/LICENSE The BSD License
	 * @copyright Copyright (c) 2011, James Titcumb
	 */
	class MAL_Util_TextFormatting
	{
		/**
		 * Generate a slug based on arbitrary text
		 *
		 * @author <NAME> <<EMAIL>>
		 *
		 * @param string $value The arbitrary text to slug-ify
		 * @return string
		 */
		public static function MakeSlug($value)
		{
			$slug = strtolower($value);
			$slug = preg_replace("/[^a-zA-Z0-9\s]/", "", $slug);
			$slug = trim($slug);
			$slug = preg_replace("/[\s+^$]/", "-", $slug);

			return $slug;
		}
		
		/**
		 * Reverse of self::MakeSlug 
		 * 
		 * @param string $value 
		 * @return string
		 */
		public static function UnmakeSlug($value)
		{
			$plain_text = ucfirst($value);
			$plain_text = preg_replace("/[-]/", " ", $plain_text);
			
			return $plain_text;
		}
	}

{'fraction_non_alphanumeric': 0.16272824919441461, 'fraction_numerical': 0.00644468313641246, 'mean_word_length': 2.9554140127388533, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 20, 'https://': 2, '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': '4501982', 'n_tokens_mistral': 728, 'n_tokens_neox': 617, 'n_words': 162}