NAME

Text::Beautify - Beautifies text

SYNOPSIS

use Text::Beautify;

$text = "badly written text ,,you know ?"

$new_text = beautify($text);
# $new_text now holds "Badly written text, you know?"

# or

$text = Text::Beautify->new("badly written text ,,you know ?");
$new_text = $text->beautify;

# and also

enable_feature('repeated_punctuation'); # enables the feature
disable_feature('trailing_space');      # disables the feature

@features_enables = enabled_features();

@all_features = features();

enable_all();
disable_all();

DESCRIPTION

Beautifies text. This involves operations like squeezing double spaces, removing spaces from the beginning and end of lines, upper casing the first character in a string, etc.

You can enable / disable features with enable_feature / disable_feature. These commands return a true value if they are successful.

To know which features are beautified, see FEATURES

FEATURES

All features are enabled by default

  • heading_space

    Removes heading spaces
  • trailing_space

    Removes trailing spaces
  • double_spaces

    Squeezes double spaces
  • repeated_punctuation

    Squeezes repeated punctuation
  • space_in_front_of_punctuation

    Removes spaces in front of punctuation
  • space_after_punctuation

    Puts a spaces after punctuation
  • uppercase_first

    Uppercases the first character in the string

BUGS

Each line is treated independently. This means a sentence comprising two lines will get it's second line's first character uppercased... must solve that ASAP.

Smiles such as "this :-(" are turned into "this:-("

AUTHOR

Jose Alves de Castro, <cog [at] cpan [dot] org<gt>

COPYRIGHT AND LICENSE

Copyright 2004 by Jose Alves de Castro

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.