<commit_before><?php

namespace WernerDweight\Dobee\Transformer;

use WernerDweight\Dobee\Transformer\Inflect;

class Transformer {

	public static function smurf($string,$smurf = 'dobee'){
		return $smurf.'_'.$string;
	}

	public static function camelCaseToUnderscore($string){
		preg_match_all('/([A-Z\.][A-Z0-9\.]*(?=$|[A-Z\.][a-z0-9\.])|[A-Za-z\.][a-z0-9\.]+)/',$string,$matches);
		$words = $matches[0];
		foreach ($words as $key => $word) {
			$words[$key] = ($word == strtoupper($word) ? strtolower($word) : lcfirst($word));
		}
		return implode('_',$words);
	}

	public static function underscoreToCamelCase($string){
		return ucfirst(str_replace(' ','',ucwords(str_replace('_',' ',$string))));
	}

	public static function pluralize($string){
		return Inflect::pluralize($string);
	}

	public static function singularize($string){
		return Inflect::singularize($string);
	}

	public static function strip($string,$front = true){
		/// get position of the separating dot
		$pos = intval(strpos($string,'.'));
		/// if there is a dot, strip string
		if($pos > 0){
			if($front === true){
				return substr($string,$pos+1);
			}
			else{
				return substr($string,0,$pos);
			}
		}
		else{
			return $string;
		}
	}
<commit_msg>Added possibility to use multiple separate conditions on one column (via ~\d ending)<commit_after><?php

namespace WernerDweight\Dobee\Transformer;

use WernerDweight\Dobee\Transformer\Inflect;

class Transformer {

	public static function smurf($string,$smurf = 'dobee'){
		return $smurf.'_'.$string;
	}

	public static function camelCaseToUnderscore($string){
		preg_match_all('/([A-Z\.][A-Z0-9\.]*(?=$|[A-Z\.][a-z0-9\.])|[A-Za-z\.][a-z0-9\.]+)/',$string,$matches);
		$words = $matches[0];
		foreach ($words as $key => $word) {
			$words[$key] = ($word == strtoupper($word) ? strtolower($word) : lcfirst($word));
		}
		return implode('_',$words);
	}

	public static function underscoreToCamelCase($string){
		return ucfirst(str_replace(' ','',ucwords(str_replace('_',' ',$string))));
	}

	public static function pluralize($string){
		return Inflect::pluralize($string);
	}

	public static function singularize($string){
		return Inflect::singularize($string);
	}

	public static function strip($string,$front = true){
		/// remove trailing tilda-string (if any)
		$string = preg_replace('/~.*$/','',$string);
		/// get position of the separating dot
		$pos = intval(strpos($string,'.'));
		/// if there is a dot, strip string
		if($pos > 0){
			if($front === true){
				return substr($string,$pos+1);
			}
			else{
				return substr($string,0,$pos);
			}
		}
		else{
			return $string;
		}
	}

{'fraction_non_alphanumeric': 0.19710806697108066, 'fraction_numerical': 0.0076103500761035, 'mean_word_length': 4.365306122448979, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5908527', 'n_tokens_mistral': 1040, 'n_tokens_neox': 937, 'n_words': 189}