<commit_before><?php
/*
Plugin Name: Capital Letters
License: GPL
Version: 1.0.1
Plugin URI: http://thecellarroom.net/plugins
Author: The Cellar Room Limited
Author URI: http://www.thecellarroom.net
Donation URI: http://thecellarroom.net/plugins
Copyright (c) 2013 The Cellar Room Limited
Description: Simply auto uppercases the first letter of the first word after finding a full stop in your post content. 
             No options or settings, works out of the box, simply just activate.
*/
###################################################################################
defined( 'ABSPATH' ) or die();

function TCR_CL_replace_content($content)
{
$content=preg_replace_callback( '|(?:\.)(?:\s*)(\w{1})|Ui',create_function('$matches', 'return ". ".strtoupper($matches[1]);'),ucfirst($content)); 
return $content;
}
add_filter('the_content','TCR_CL_replace_content');

###################################################################################

?><commit_msg>Update tcr_plugin.php<commit_after><?php
/*
Plugin Name: Capital Letters
License: GPL
Version: 1.0.1
Plugin URI: http://thecellarroom.net/plugins
Author: The Cellar Room Limited
Author URI: http://www.thecellarroom.net
Donation URI: http://thecellarroom.net/plugins
Copyright (c) 2013 The Cellar Room Limited
Description: Simply auto uppercases the first letter of the first word after finding a full stop in your post content.
auto fixes post titles too. No options or settings, works out of the box, simply just activate.
*/
###################################################################################
defined( 'ABSPATH' ) or die();

function TCR_CL_replace_content($content)
{
$content=preg_replace_callback( '|(?:\.)(?:\s*)(\w{1})|Ui',create_function('$matches', 'return ". ".strtoupper($matches[1]);'),ucfirst($content)); 
return $content;
}
add_filter('the_content','TCR_CL_replace_content');


function lowertitle($title)  {
$title = strtolower($title);
return $title;
}

function fixtitle($title) {
$smallwordsarray = array( 'of','a','the','and','an','or','nor','but','is','if','then','else','when', 'at','from','by','on','off','for','in','out','over','to','into','with' ); 
$words = explode(' ', $title); 
foreach ($words as $key => $word) {
if ($key == 0 or !in_array($word, $smallwordsarray)) $words[$key] = ucwords($word); 
} 
$newtitle = implode(' ', $words); return $newtitle; }

add_filter('title_save_pre','lowertitle');
add_filter('the_title','lowertitle');
add_filter('title_save_pre','fixtitle');
add_filter('the_title','fixtitle');

}

###################################################################################

?>
{'fraction_non_alphanumeric': 0.2818459191456903, 'fraction_numerical': 0.007246376811594203, 'mean_word_length': 7.488673139158576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3908746', 'n_tokens_mistral': 786, 'n_tokens_neox': 760, 'n_words': 193}