The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

Lingua::EN::SimilarNames::Levenshtein - Compare people first and last names.

Synopsis

    my $first_person = Person->new(
        first_name => 'John',
        last_name => 'Wayne',
    );
    my $second_person = Person->new(
        first_name => 'Sundance',
        last_name => 'Kid',
    );
    my $third_person = Person->new(
        first_name => 'Jose',
        last_name => 'Wales',
    );
    my @list_of_people = ($first_person, $second_person, $third_person);
    my $similar_people = SimilarNames->new(list_of_people => \@list_of_people, maximum_distance => 12);
 

Description

Given a list of people names as an ArrayRef[ArrayRef[Str]], then have access to the list of people name pairs that are within a certain 'edit distance' of on another.

Methods

list_of_similar names

This is called on a SimilarNames object to return list of name pairs that are similar using the Levenshtein edit distance. This means they are close to one another in spelling.

Authors

Mateu X. Hunter hunter@missoula.org

Copyright

Copyright 2010, Mateu X. Hunter

License

You may distribute this code under the same terms as Perl itself.