nl_tokens: * @method titleize () @returns String @short Creates a title version of the string . @extra Capitalizes all the words and replaces some characters in the string to create a nicer looking title . String#titleize is meant for creating pretty output . @example
pl_tokens: function ( ) { var fullStopPunctuation = / [.:;!]$ / , hasPunctuation , lastHadPunctuation , isFirstOrLast ; return this . spacify ( ) . humanize ( ) . words ( function ( <mask> , index , words ) { hasPunctuation = fullStopPunctuation . test ( word ) ; isFirstOrLast = index == 0 || index == words . length - 1 || hasPunctuation || lastHadPunctuation ; lastHadPunctuation = hasPunctuation ; if ( isFirstOrLast || Downcased . indexOf ( word ) === - 1 ) { return capitalize ( word ) ; } else { return word ; } } ) . join ( ' ' ) ; }