Text::Beautify - Beautifies text
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();
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
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
Creates a new Text::Beautify object
Applies all the enabled features
Returns a list with the enabled features
Returns a list containing all the features
Enables a feature
Disables a feature
Enables all features
Disables all features
Allow the user to select the order in which features are applied
Allow creation of new features
Jose Castro, <cog@cpan.org>
<cog@cpan.org>
Copyright 2004 Jose Castro, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Text::Beautify, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Beautify
CPAN shell
perl -MCPAN -e shell install Text::Beautify
For more information on module installation, please visit the detailed CPAN module installation guide.