- SEE ALSO
- COPYRIGHT AND LICENSE
Lingua::EN::CMUDict - Perl extension for utilizing the CMU dictionary file
use Lingua::EN::CMUDict; my $obj = new Lingua::EN::CMUDict; print $obj->number_of_syllables("test");
This version of the CMU Pronouncing dictionary was generated from the original dictionary and designed to syllabify it. The paper On the Syllabification of Phonemes by Susan Bartlett, Grzegorz Kondrak and Colin Cherry (NAACL-HLT 2009) covers the methods used to generate the dictionary.
None by default.
Creates a new object, populating it with the cmusyldict db file. If the cmudict argument is passed with a filename as the argument, that file is used. If you do not use that argument, the default cmusyldict db file installed with the module is used.
In the case of an array being returned, returns all rhymes to the given word. In a scalar context, returns a single rhyme.
Returns the number of syllables in the word. Many pluralities do not add syllable counts and are therefore not in the original database. This code tries to be intelligent by looking for those and returning the number of syllables. Also, if a sentence is passed in, returns the number of syllables in the sentence. Doesn't currently deal with punctuation very well.
Returns the pronunciation for the word with syllable boundaries.
Lingua::EN::Phoneme -- another way of accessing the CMU Pronunciation dictionary.
Leigh Metcalf, <email@example.com>
Copyright (C) 2011 by Leigh Metcalf
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.