NAME
Lingua::Rhyme - MySQL-based rhyme-lookups.
SYNOPSIS
use Lingua::Rhyme;
my @rhymes_for_house = @{ Lingua::Rhyme::find('house') };
warn "Test if 'house' rhymes with 'mouse'....\n";
if (Lingua::Rhyme::match("house","mouse")){
warn "They rhyme.\n";
} else {
warn "They don't rhyme!";
}
__END__
DESCRIPTION
This module uses an SQL database of rhyming words to find words that rhyme. See the &build function for further information.
This is actually Text::Rhyme version 0.04, but rhyming is now considered a linguist, rather than a textual, operation.
INSTALLATION
See the enclosed file, INSTALL
.
PREREQUISITES
MySQL
DBI.pm
CLASS VARIABLES
The following variables must be set by the user to access the database.
- $database
-
The name of the rhyming dictionary database that will be created. Defaults to
rhymedict
. - $hostname =item $port =item $user =item $password
-
You can set
$chat
for real-time chat on what's up.
FUNCTIONS
&build
Running this function will create a MySQL database of two tables from the two supplied textfiles, words.txt
and rhymes.txt
, which should be in the same sub-directory Rhyme/dict/EN/. If these tables exist, they will be dropped.
&find ($word_to_match)
Accepts a scalar of one word to lookup, and returns a reference to an array of rhyming words, or undef
on failure.
&match ($word1,$word2)
Returns 1
if $word1
rhymes with $word2
, otherwise returns undef
.
CAVEATS
There appear to be duplicate entires in the DB:
DBD::mysql::db do failed: Duplicate entry '#?2,M+?*.+' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 13570.
DBD::mysql::db do failed: Duplicate entry '7*?7\.?/.N' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 16070.
DBD::mysql::db do failed: Duplicate entry 'E,[' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 20111.
DBD::mysql::db do failed: Duplicate entry 'E1=' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 20397.
DBD::mysql::db do failed: Duplicate entry '02)?#D/.?2' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 20623.
DBD::mysql::db do failed: Duplicate entry 'e,:' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 25587.
DBD::mysql::db do failed: Duplicate entry 'E)@' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 25605.
DBD::mysql::db do failed: Duplicate entry 'e):' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 30844.
DBD::mysql::db do failed: Duplicate entry 'e2:' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 30983.
DBD::mysql::db do failed: Duplicate entry 'e"[' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 34284.
DBD::mysql::db do failed: Duplicate entry 'E#,U' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 34545.
DBD::mysql::db do failed: Duplicate entry 'e4:' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 34637.
DBD::mysql::db do failed: Duplicate entry '-T2,M+?*.+' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 36221.
DBD::mysql::db do failed: Duplicate entry '/B+,=' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 41578.
DBD::mysql::db do failed: Duplicate entry '4T2)A#?/.N' for key 1 at E:\Src\Pl\Text\Rhyme\build.pl line 53, <WORDS> line 41821.
TODO
- Multiples
-
Multiple pronounciations are available but not yet implimented.
- Languages
-
If I can find dictionaries for German and Yiddish (or others), I'll add those too.
SEE ALSO
DBI; MySQL; The Rhyming Dictionary; Carnegie Mellon University Pronouncing Dictionary; perl(1).
ACKNOWLEDGMENTS
A thousand thanks to Brian "tuffy" Langenberger for the database files used in his Rhyming Dictionary. Brain writes that his 'work is based wholly on the work of the Carnegie Mellon University Pronouncing Dictionary'.
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.
4 POD Errors
The following errors were encountered while parsing the POD:
- Around line 47:
'=item' outside of any '=over'
- Around line 72:
You forgot a '=back' before '=head1'
- Around line 228:
'=item' outside of any '=over'
- Around line 236:
You forgot a '=back' before '=head1'