Lee ♫ Goddard

NAME

Lingua::Rhyme::FindScheme - find rhyme schemes in text.

SYNOPSIS

        use Lingua::Rhyme::FindScheme;

        my @shakespeare_sonnet_ii =  (
                "When forty winters shall beseige thy brow,",
                "And dig deep trenches in thy beauty's field,",
                "Thy youth's proud livery, so gazed on now,",
                "Will be a tatter'd weed, of small worth held:",
                "Then being ask'd where all thy beauty lies,",
                "Where all the treasure of thy lusty days,",
                "To say, within thine own deep-sunken eyes,",
                "Were an all-eating shame and thriftless praise.",
                "How much more praise deserved thy beauty's use,",
                "If thou couldst answer 'This fair child of mine",
                "Shall sum my count and make my old excuse,'",
                "Proving his beauty by succession thine!",
                "  This were to be new made when thou art old,",
                "  And see thy blood warm when thou feel'st it cold."
        );

        my %scheme = %{Lingua::Rhyme::FindScheme::list_couplets (@shakespeare_sonnet_ii)};
        foreach (sort {$a <=> $b} keys %scheme){
                warn "Scheme $_ = $scheme{$_}\n";
        }

        my $i=0;
        foreach my $scheme ( Lingua::Rhyme::FindScheme::endings(@shakespeare_sonnet_ii) ){
                warn "Line ",$i+1," ... $scheme ... $shakespeare_sonnet_ii[$i]\n";
                ++$i;
        }

        __END__

PREREQUISITES

        Lingua::Rhyme

DESCRIPTION

This is the first version of a module which will grow with my needs.

All requests/suggestions much appreciated.

FUNCTIONS

&list_couplets

Accepts an array of text, and returns a reference to a hash where keys and values are numbers of couplets. NB: the line number index begins at zero.

&endings (@text)

Accepts an array of text, and scans it for a scheme of rhymes at line ends, returning an array of the scheme.

SEE ALSO

Lingua::Rhyme; perl(1).

AUTHOR

Lee Goddard <lgoddard@cpan.org>

COPYRIGHT

Copyright (C) Lee Goddard, 30/05/2001 ff.

This is free software, and can be used/modified under the same terms as Perl itself.