<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME

Lingua::EN::NameParse - extract the components of a person or couples full name, presented as a text string

SYNOPSIS

    use Lingua::EN::NameParse qw(clean case_surname);

    # optional configuration arguments
    my %args =
    (
        auto_clean      =&gt; 1,
        force_case      =&gt; 1,
        lc_prefix       =&gt; 1,
        initials        =&gt; 3,
        allow_reversed  =&gt; 1,
        joint_names     =&gt; 0,
        extended_titles =&gt; 0
    );

    my $name =  Lingua::EN::NameParse-&gt;new(%args);

    $error = $name-&gt;parse("MR AC DE SILVA");

    %name_comps = $name-&gt;components;
    $surname = $name_comps{surname_1}; # De Silva

    $correct_casing = $name-&gt;case_all; # Mr AC de Silva

    $correct_casing = $name-&gt;case_all_reversed ; # de Silva, AC

    $good_name = &amp;clean("Bad Na9me   "); # "Bad Name"
 
    $salutation = $name-&gt;salutation(salutation =&gt; 'Dear',sal_default =&gt; 'Friend')); # Dear Mr de Silva

    %my_properties = $name-&gt;properties;
    $number_surnames = $my_properties{number}; # 1
    $bad_input = $my_properties{non_matching};

    $name-&gt;report; # create a report listing all information about the parsed name

    $lc_prefix = 0;
    $correct_case = &amp;case_surname("DE SILVA-MACNAY",$lc_prefix); # De Silva-MacNay


DESCRIPTION

This module takes as input a person or persons name in
free format text such as,

    Mr AB &amp; M/s CD MacNay-Smith
    MR J.L. D'ANGELO
    Estate Of The Late Lieutenant Colonel AB Van Der Heiden

and attempts to parse it. If successful, the name is broken
down into components and useful functions can be performed like :

- converting upper or lower case values to name case (Mr AB MacNay   )
- creating a personalised greeting or salutation     (Dear Mr MacNay )
- extracting the names individual components         (Mr,AB,MacNay   )
- determining the type of format the name is in      (Mr_A_Smith     )

If the name cannot be parsed you have the option of cleaning the name
of bad characters, or extracting any portion that was parsed and the
portion that failed.

This module can be used for analysing and improving the quality of
lists of names.



HOW TO INSTALL

    perl Makefile.PL
    make
    make test
    make install
    
    or
    
    perl Build.PL
    build
    build test
    build install    


AUTHOR

NameParse was written by Kim Ryan, kimryan at cpan dot org

COPYRIGHT AND LICENSE

Copyright (c) 2016 Kim Ryan. All rights reserved.
This program is free software; you can redistribute it
and/or modify it under the terms of the Perl Artistic License
(see http://www.perl.com/perl/misc/Artistic.html).

</pre></body></html>