<commit_before><?php
require_once(MODELS_PATH.'base_model.php');

/**
* 
*/
class Author extends BaseModel{
	static function displayName(): string{
		return 'Author';
	}

	protected static function indexSelectQuery(): string{
		return 'SELECT id, author_first, author_middle, author_last FROM '.self::dbTableName();
	}

	static function defaultOrdering(): string{
		return ' author_last, author_first, author_middle';
	}

	static function toString(array $model): string{
		return $model['author_first'];
	}
}<commit_msg>Add proper formatting for author names<commit_after><?php
require_once(MODELS_PATH.'base_model.php');

/**
* 
*/
class Author extends BaseModel{
	static function displayName(): string{
		return 'Author';
	}

	protected static function indexSelectQuery(): string{
		return 'SELECT id, author_first, author_middle, author_last FROM '.self::dbTableName();
	}

	static function defaultOrdering(): string{
		return ' author_last, author_first, author_middle';
	}

	static function toString(array $model): string{
		$name = '';
		if(!empty($model['author_last'])){
			$name = $model['author_last'].', ';
		}
		$name = $name.$model['author_first'];
		
		if(!empty($model['author_middle'])){
			$name = $name.' '.$model['author_middle'];
			//add period after one letter middle names (initials)
			if(strlen($model['author_middle']) == 1){
				$name = $name.'.';
			}
		}

		return $name;
	}
}
{'fraction_non_alphanumeric': 0.15444839857651246, 'fraction_numerical': 0.0007117437722419929, 'mean_word_length': 5.113043478260869, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3788194', 'n_tokens_mistral': 474, 'n_tokens_neox': 438, 'n_words': 107}