Text::Phonetic::Metaphone - Metaphone algorithm


Text-Phonetic documentation Contained in the Text-Phonetic distribution.

Index


Code Index:

NAME

Top

Text::Phonetic::Metaphone - Metaphone algorithm

DESCRIPTION

Top

Metaphone was developed by Lawrence Philips as a response to deficiencies in the Soundex algorithm. It is more accurate than Soundex because it uses a larger set of rules for English pronunciation. (Wikipedia, 2007)

This module is a thin wrapper arround Text::Metaphone.

The parameter max_length can be set to limit the length of the encoded string.

AUTHOR

Top

    Maroš Kollár
    CPAN ID: MAROS
    maros [at] k-1.com
    http://www.k-1.com

COPYRIGHT

Top

SEE ALSO

Top

Description of the algorithm can be found at http://en.wikipedia.org/wiki/Metaphone

Text::Metaphone


Text-Phonetic documentation Contained in the Text-Phonetic distribution.

# ============================================================================
package Text::Phonetic::Metaphone;
# ============================================================================
use utf8;

use Moose;
extends qw(Text::Phonetic);

has 'max_length'=> (
    is              => 'rw',
    isa             => 'Int',
    documentation   => q[Limit the length of the encoded string],
    default         => 0,
);

__PACKAGE__->meta->make_immutable;

our $VERSION = $Text::Phonetic::VERSION;

sub _predicates {
    return 'Text::Metaphone';
}

sub _do_encode {
    my ($self,$string) = @_;
    
    return Text::Metaphone::Metaphone($string,$self->max_length);
}

1;