Text::Names - Perl extension for name parsing and normalization
use Text::Names qw/parseNames samePerson/; my @authors = parseNames("D Bourget, Zbigniew Z Lukasiak and John Doe"); # @authors = ('Bourget, D.','Lukasiak Z., Zbigniew','Doe, John') print "same!" if samePerson("Dave Bourget","David F. Bourget"); # same!
This modules provides a number of name normalization routines, plus high-level parsing and name comparison utilities such as those illustrated in the synopsis.
While it tries to accommodate non-Western names, this module definitely works better with Western names, especially English-style names.
No subroutine is exported by default.
This modules normalizes names to this format:
Lastname(s) [Jr], Given name(s)
Takes a string of names as parameters and returns an array of normalized representations of the names in the string. This routines understands a wide variety of formattings for names and lists of names.
Takes an array of names (as strings) and returns an array of normalized representations of the names in the array.
Takes a name in one of the multiple formats that one can write a name in, and returns it in a normalized form.
Likes parseName, but does additional cleaning-up. To be prefered to parseName in most cases.
Use on already-normalized names to split them into four parts: full given names, initials, last names, and suffix. The only 'suffix' recognied is 'Jr'.
Returns true iff name1 is a common abbreviation of name2 in English. For example, 'Dave' is a common abbreviation of 'David'. The list of abbreviations used includes a number of old abbreviations such as 'Davy' for 'David'.
Sets the abbreviation mapping used to determine whether, say, 'David' and 'Dave' are compatible name parts. The mapping is also use by abbreviationOf(). The format of the array should be: 'Dave', 'David', 'Davy', 'David', etc, otherwise representable in Perl as 'Dave' => 'David', 'Davy' => 'David', etc.
Returns an array of normalizations names which are weakenings of the name passed as argument. Substituting a given names by an initial, or removing an initial, for example, are operations which generate weakenings of a name. Such operations are applied with arbitrary depth, until the name has been reduced to a single initial followed by the lastname, and all intermediary steps returned.
Returns a true value iff name1 and name2 could reasonably be two writings of the same name. For example, 'D J Bourget' could reasonably be a writing of 'David Joseph Bourget'. So could 'D Bourget'. But 'D F Bourget' is not a reasonable writing of 'David Joseph Bourget'. The value returned is a (potentially new) name string which combines the most complete tokens of the two submitted name strings.
Contrary to what one might expect, this subroutine does not use weakenings() behind the scenes. Another way to check for name compatibility would be to check that two names have a weakening in common (probably too permissive for most purposes) or that one name is a weakening of the other.
Returns the name in the "last, given" format.
Given a normalized name of the form "last, given", returns "given last".
Normalizes the withspace within a name.
None by default.
The xPapers application framework from which this has been extracted, www.xpapers.org
The related Biblio::Citation::Compare module.
David Bourget
Copyright (C) 2011 by David Bourget
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =old
To install Text::Names, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Names
CPAN shell
perl -MCPAN -e shell install Text::Names
For more information on module installation, please visit the detailed CPAN module installation guide.