Raised This Month: $51 Target: $400
 12% 

[Any] Capitalizer 0x06 (Last Updated 1/23/2015 | 10:14PM CDT)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Plugin ID:
4390
Plugin Version:
0x06
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
Automatically capitalizes the first word of every sentence.
Old 10-19-2014 , 14:41   [Any] Capitalizer 0x06 (Last Updated 1/23/2015 | 10:14PM CDT)
Reply With Quote #1

[ANY] Capitalizer
Before you give a suggestion, read the TODO list. It's probably already there.

Description:
  • This plugin capitalizes the first word of any sentence, the first word after any punctuation, and the letter 'i'.

    Based of off/inspired by Runescape's chat filtering.

    A.K.A. BeTheGrammarNazi
Convar: tf/cfg/sourcemod/ch.capitalizer.cfg
  • cv_capitalizer_lowercase (Default: 0) - 0 = PEOPLE CAN TYPE IN FULL CAPS | 1 = Automagically lowercase other letters
Installation:Changelist:
Spoiler

TODO:
Quote:
Stuff to add:

* Other languages?
* Special characters?
Credits:
  • minimoney1 - Maker of Simple Chat Processor (Redux)
Want support?
  • Post questions and...
    Join TF2Data if you have questions not related to this plugin.
Wanna support me?
  • Post suggestions (read the TODO list first) and...
    Join TF2Data, play on our servers, or donate! ;p
    (See siggy for links!)
For people interested in GitHub:
https://github.com/Chdata/SM-Capitalizer
Attached Files
File Type: smx capitalizer.smx (3.8 KB, 260 views)
File Type: sp Get Plugin or Get Source (capitalizer.sp - 332 views - 2.6 KB)
__________________

Last edited by Chdata; 03-28-2015 at 06:32.
Chdata is offline
robotortoise
Senior Member
Join Date: Nov 2013
Old 10-19-2014 , 15:42   Re: [Any] Capitalized First Word 0x01 (Last updated *Today* 10/19/2014 | 1:31PM CDT)
Reply With Quote #2

Useful!

May I suggest renaming the smx file to something more informative?
__________________
-Robotortoise [Palutena's Bro]

If you ever need help with Wii/Gamecube/DS sounds/music/ect., I'm your man!

Contact me via Steam

I don't bite.


How to loop and compress .wav files

Me and my friends' server
robotortoise is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 10-19-2014 , 16:17   Re: [Any] Capitalized First Word 0x01 (Last updated *Today* 10/19/2014 | 1:31PM CDT)
Reply With Quote #3

lol I just noticed I got the acronym wrong.
__________________

Last edited by Chdata; 10-19-2014 at 16:18.
Chdata is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 10-19-2014 , 16:44   Re: [Any] Capitalized First Word 0x01 (Last updated *Today* 10/19/2014 | 1:31PM CDT)
Reply With Quote #4

does it support non-latin letters?
if so, please, add a config file where we could add a list of characters replacements.
Leonardo is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 11-01-2014 , 02:40   Re: [Any] Capitalized First Word 0x02 (Last updated *Today* 11/1/2014 | 1:32AM CDT)
Reply With Quote #5

Made a small change to rename things.

And I figured nobody needs a convar to enable/disable it when you can just use sm plugins unload capitalizer.
__________________
Chdata is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-23-2015 , 01:42   Re: [Any] Capitalized First Word 0x03 (Last Updated 1/23/2015 | 12:36AM CDT)
Reply With Quote #6

Updated again to optimize it a little.
__________________
Chdata is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-23-2015 , 01:45   Re: [Any] Capitalized First Word 0x03 (Last Updated 1/23/2015 | 12:36AM CDT)
Reply With Quote #7

you could add some more logic into it and make it so after each period it capitalizes each letter, plus lowercases all other letters
Mitchell is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-23-2015 , 03:01   Re: [Any] Capitalized First Word 0x03 (Last Updated 1/23/2015 | 12:36AM CDT)
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
you could add some more logic into it and make it so after each period it capitalizes each letter, plus lowercases all other letters
Done. It also capitalizes the letter I if it's either surrounded by whitespace...

Or is [WHITESPACE or start of string][LETTER I][AN APOSTRAPHE'][AN ALPHABETS but not the end of the string].

I added a bool in the capitalize function that lowercases everything else, but you'll have to change / recompile the plugin yourself if you want that, for now.

I'll probably change it to these specific cases tho:

I'd I'd've I'll I'm I've

I'm not sure if my string logic is 100% correct though. It seems like it is I guess and a quick test seemed to be okay.

Edit: For whatever reason it capitalizes aaaaaaaaaaaaai [end]'s 'i'
__________________

Last edited by Chdata; 01-23-2015 at 03:33.
Chdata is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-23-2015 , 14:54   Re: [Any] Capitalizer 0x05 (Last Updated *Today* 1/23/2015 | 1:47PM CDT)
Reply With Quote #9

Probably final update, I added the convar for lowercasing everything else.
__________________
Chdata is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode