Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    String::CaseProfile 0.18

    Download button

    No screenshots available
    Downloads: 154  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Enrique Nell | More programs
    Perl Artistic License / FREE
    November 27th, 2010, 12:42 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    String::CaseProfile description

    Get/Set the letter case profile of a string

    String::CaseProfile is a Perl module that provides a convenient way of handling the recasing (letter case conversion) of sentences/phrases/chunks in machine translation, case-sensitive search and replace, and other text processing applications.

    SYNOPSIS

     use String::CaseProfile qw(get_profile set_profile copy_profile);
     
     my $reference_string = 'Some reference string';
     my $string = 'sample string';
     
     
     # Typical, single-line usage
     my $target_string = set_profile($string, get_profile($reference_string));
     
     # Alternatively, you can use the 'copy_profile' convenience function:
     my $target_string = copy_profile(
     from => $reference_string,
     to => $string,
     );
     
     
     # Get the profile of a string and access the details
     my %ref_profile = get_profile($reference_string);
     
     my $string_type = $ref_profile{string_type};
     my $profile_str = $ref_profile{fold}; # 'fll'
     my $word = $ref_profile{words}[2]->{word}; # third word
     my $word_type = $ref_profile{words}[2]->{type};
     
     # See a profile report
     print "$ref_profile{report}"; # No need to add \n
     
     # Apply the profile to another string
     my $new_string = set_profile($string, %ref_profile);
     
     
     # Use custom profiles
     my %profile1 = ( string_type => '1st_uc' );
     $new_string = set_profile($string, %profile1);
     
     my %profile2 = ( string_type => 'all_lc', force_change => 1 );
     $new_string = set_profile($string, %profile2);
     
     my %profile3 = (
     custom => {
     default => 'all_lc',
     all_uc => '1st_uc',
     index => {
     3 => '1st_uc',
     5 => 'all_lc',
     },
     }
     );
     $new_string = set_profile($string, %profile3);



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    letter case | case profile | Perl module | letter | case | profile

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM