Lingua::EN::Phoneme - Simple and fast access to cmudict English pronunciation data


Lingua-EN-Phoneme documentation  | view source Contained in the Lingua-EN-Phoneme distribution.

Index


NAME

Top

Lingua::EN::Phoneme - Simple and fast access to cmudict English pronunciation data

AUTHOR

Top

Thomas Thurman <tthurman@gnome.org>

SYNOPSIS

Top

  use Lingua::EN::Phoneme;
  my $lep = new Lingua::EN::Phoneme();
  for ($lep->phoneme('cakes')) { print "$_ is a phoneme"; }
  # prints:
  #   K is a phoneme
  #   EY1 is a phoneme
  #   K is a phoneme
  #   S is a phoneme
  print scalar($lep->phoneme('ale'));
  # prints:
  #   EY1 L

DESCRIPTION

Top

Lingua::EN::Phoneme provides simple access to the phonemic English data in the Carnegie-Mellon pronouncing dictionary. Unlike Lingua::Phoneme, it does not require a DBI connection to run, or any setup time on the host computer. The data is supplied in a standard Berkeley database, which should be entirely platform-independent.

METHODS

Top

phoneme($latin)

The argument is the representation of an English word in the Latin alphabet. In array context, the method returns a list of the phonemes in the word. Vowels have "0", "1", or "2" suffixes to indicate no, primary, or secondary stress. In scalar context, the method returns the same list joined into a string by single spaces. If the word is not in the dictionary, returns an empty list or undef according to the context.

COPYRIGHT

Top

SEE ALSO

Top

Lingua::Phoneme.


Lingua-EN-Phoneme documentation  | view source Contained in the Lingua-EN-Phoneme distribution.