r72086 - in /branches/upstream/liblingua-en-nameparse-perl/current: Changes META.yml lib/Lingua/EN/NameParse.pm lib/Lingua/EN/NameParse/Grammar.pm

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Thu Mar 31 08:41:28 UTC 2011


Author: periapt-guest
Date: Thu Mar 31 08:41:19 2011
New Revision: 72086

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72086
Log:
[svn-upgrade] new version liblingua-en-nameparse-perl (1.30)

Modified:
    branches/upstream/liblingua-en-nameparse-perl/current/Changes
    branches/upstream/liblingua-en-nameparse-perl/current/META.yml
    branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse.pm
    branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse/Grammar.pm

Modified: branches/upstream/liblingua-en-nameparse-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liblingua-en-nameparse-perl/current/Changes?rev=72086&op=diff
==============================================================================
--- branches/upstream/liblingua-en-nameparse-perl/current/Changes (original)
+++ branches/upstream/liblingua-en-nameparse-perl/current/Changes Thu Mar 31 08:41:19 2011
@@ -1,4 +1,9 @@
 Revision history for Perl CPAN module Lingua::En::NameParse
+
+1.30 31 Marr 2011
+    Added component ordering for Mr_J_Adam_Smith name type, thanks to John Hansen
+    Corrected some of the documentation
+    Added more military titles
 
 1.29 23 Jan 2011
    Corrected documentation of case_components module, thanks to John Hansen

Modified: branches/upstream/liblingua-en-nameparse-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liblingua-en-nameparse-perl/current/META.yml?rev=72086&op=diff
==============================================================================
--- branches/upstream/liblingua-en-nameparse-perl/current/META.yml (original)
+++ branches/upstream/liblingua-en-nameparse-perl/current/META.yml Thu Mar 31 08:41:19 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Lingua-EN-NameParse
-version:            1.29
+version:            1.30
 abstract:           Manipulate peoples names, titles and initials
 author:
     - Kim Ryan

Modified: branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse.pm?rev=72086&op=diff
==============================================================================
--- branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse.pm (original)
+++ branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse.pm Thu Mar 31 08:41:19 2011
@@ -92,11 +92,16 @@
 To describe the formats supported by NameParse, a short hand representation
 of the name is used. The following formats are currently supported :
 
+    Mr_John_Smith_&_Ms_Mary_Jones
     Mr_A_Smith_&_Ms_B_Jones
     Mr_&_Ms_A_&_B_Smith
     Mr_A_&_Ms_B_Smith
     Mr_&_Ms_A_Smith
     Mr_A_&_B_Smith
+    John_Smith_&_Mary_Jones
+    John_&_Mary_Smith
+    A_Smith_&_B_Jones
+    
     Mr_John_Adam_Smith
     Mr_John_A_Smith
     Mr_J_Adam_Smith
@@ -109,19 +114,8 @@
     A_Smith
     John
 
-Precursors and suffixes are only applied to the following formats:
-
-    Mr_John_Adam_Smith
-    Mr_John_A_Smith
-    Mr_J_Adam_Smith    
-    Mr_John_Smith
-    Mr_John_Smith
-    Mr_A_Smith
-    John_Adam_Smith
-    John_A_Smith
-    J_Adam_Smith
-    John_Smith
-    A_Smith
+Precursors and suffixes may be applied to single names that include a surname
+
 
 
 =head1 METHODS
@@ -435,6 +429,7 @@
    Macbeth or MacBeth, are both valid spellings
    Is ED WOOD E.D. Wood or Edward Wood
    Is 'Mr Rapid Print' a name or a company
+   Does  John Bradfield Smith have a middle name of Bradfield, or a surname of Bradfield-Smith?
 
 One approach is to have large lookup files of names and words, statistical rules
 and fuzzy logic to attempt to derive context. This approach gives high levels of
@@ -480,10 +475,6 @@
    Add transforming methods to do things like remove dots from initials
    Try to derive gender (Mr... is male, Ms, Mrs... is female)
 
-Let the user select what level of complexity of grammar they need for
-their data. For example, if you know most of your names are in a "John Smith"
-format, you can avoid the ambiguity between two letter given names and
-initials. Using a limited grammar subset will also be much faster.
 
 Define grammar for other languages. Hopefully, all that would be needed is
 to specify a new module with its own grammar, and inherit all the existing
@@ -529,12 +520,9 @@
 Copyright (c) 2011 Kim Ryan. All rights reserved.
 
 This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.8.4 or,
-at your option, any later version of Perl 5 you may have available.
-
+it under the same terms as Perl itself.
 
 =cut
-
 #-------------------------------------------------------------------------------
 
 package Lingua::EN::NameParse;
@@ -548,7 +536,7 @@
 use Exporter;
 use vars qw (@ISA @EXPORT_OK);
 
-our $VERSION = '1.29';
+our $VERSION = '1.30';
 @ISA       = qw(Exporter);
 @EXPORT_OK = qw(&clean &case_surname);
 
@@ -716,8 +704,9 @@
     'John_&_Mary_Smith'       => ['given_name_1','conjunction_1','given_name_2','surname_1'],
     'A_Smith_&_B_Jones'       => ['initials_1','surname_1','conjunction_1','initials_2','surname_2'],
 
-    'Mr_John_Adam_Smith'      => ['precursor','title_1','given_name_1','initials_1','surname_1','suffix'],
+    'Mr_John_Adam_Smith'      => ['precursor','title_1','given_name_1','middle_name','surname_1','suffix'],
     'Mr_John_A_Smith'         => ['precursor','title_1','given_name_1','initials_1','surname_1','suffix'],
+    'Mr_J_Adam_Smith'         => ['precursor','title_1','initials_1','middle_name','surname_1','suffix'],    
     'Mr_John_Smith'           => ['precursor','title_1','given_name_1','surname_1','suffix'],
     'Mr_A_Smith'              => ['precursor','title_1','initials_1','surname_1','suffix'],
     'John_Adam_Smith'         => ['precursor','given_name_1','middle_name','surname_1','suffix'],
@@ -728,19 +717,21 @@
     'John'                    => ['given_name_1']
 );
 
+
 # only include names with a single surname
 my %reverse_component_order=
 (
    'Mr_&_Ms_A_&_B_Smith'  => ['surname_1','title_1','conjunction_1','title_2','initials_1','conjunction_1','initials_2'],
    'Mr_A_&_Ms_B_Smith'    => ['surname_1','title_1','initials_1','conjunction_1','title_2','initials_2'],
-   'Mr_&_Ms_A_Smith'      => ['surname_1','title_1','conjunction_1','title_2','initials_1'],    
-   'Mr_A_&_B_Smith'       => ['surname_1','initials_1','conjunction_1','initials_2'],
+   'Mr_&_Ms_A_Smith'      => ['surname_1','title_1','title_1','conjunction_1','title_2','initials_1'],    
+   'Mr_A_&_B_Smith'       => ['surname_1','title_1','initials_1','conjunction_1','initials_2'],
    'John_&_Mary_Smith'    => ['surname_1','given_name_1','conjunction_1','given_name_2'],
    
-   'Mr_John_Adam_Smith'   => ['surname_1','given_name_1','middle_name','suffix'],
-   'Mr_John_A_Smith'      => ['surname_1','given_name_1','initials_1','suffix'],
-   'Mr_John_Smith'        => ['surname_1','given_name_1','suffix'],
-   'Mr_A_Smith'           => ['surname_1','initials_1','suffix'],
+   'Mr_John_Adam_Smith'   => ['surname_1','title_1','given_name_1','middle_name','suffix'],
+   'Mr_John_A_Smith'      => ['surname_1','title_1','given_name_1','initials_1','suffix'],
+   'Mr_J_Adam_Smith'      => ['surname_1','title_1','initials_1','middle_name','suffix'],   
+   'Mr_John_Smith'        => ['surname_1','title_1','given_name_1','suffix'],
+   'Mr_A_Smith'           => ['surname_1','title_1','initials_1','suffix'],
    'John_Adam_Smith'      => ['surname_1','given_name_1','middle_name','suffix'],
    'John_A_Smith'         => ['surname_1','given_name_1','initials_1','suffix'],
    'J_Adam_Smith'         => ['surname_1','initials_1','middle_name','suffix'],

Modified: branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse/Grammar.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse/Grammar.pm?rev=72086&op=diff
==============================================================================
--- branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse/Grammar.pm (original)
+++ branches/upstream/liblingua-en-nameparse-perl/current/lib/Lingua/EN/NameParse/Grammar.pm Thu Mar 31 08:41:19 2011
@@ -26,10 +26,7 @@
 Copyright (c) 2011 Kim Ryan. All rights reserved.
 
 This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.8.4 or,
-at your option, any later version of Perl 5 you may have available.
-
-
+it under the same terms as Perl itself.
 
 
 =cut
@@ -39,7 +36,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.29';
+our $VERSION = '1.30';
 
 
 # Rules that define valid orderings of a names components
@@ -447,12 +444,13 @@
    
 my $extended_titles =
 q{
-                       |
-   /Messrs /i          |   # plural or Mr
-   /Mme\.? /i          |   # Madame
+                       | # contiues from titles above
+   /Messrs /i          | # plural or Mr
+   /Madam(e)? /i       |
+   /Mme\.? /i          | # Madame
    /Mister /i          |
    /Mast(\.|er)? /i    |
-   /Ms?gr\.? /i        |   # Monsignor
+   /Ms?gr\.? /i        | # Monsignor
    /Count /i           |
    /Countess /i        |   
    /Duke /i            |
@@ -461,8 +459,6 @@
    /Lady /i            |
    /Marquess i/        |
 
-   /Madam(e)? /i       |
-
    # Medical
    /Doctor /i          |
    /Sister /i          |
@@ -477,60 +473,62 @@
    /Insp\.? /i         |
 
    # Military
-   /Brig(adier)? /i       |
-   /Captain /i            |
-   /Capt\.? /i            |
-   /Colonel /i            |
-   /Col\.? /i             |
-   /Commander /i          |
-   /Commodore /i          |
-   /Cdr\.? /i             |   # Commander, Commodore
-   /Field Marshall /i     |
-   /Fl\.? Off\.? /i       |
-   /Flight Officer /i     |
-   /Flt Lt /i             |
-   /Flight Lieutenant /i  |
-   /Gen(\.|eral)? /i      |
-   /Gen\. /i              |
-   /Pte\. /i              |
-   /Private /i            |
-   /Sgt\.? /i             |
-   /Sargent /i            |
-   /Air Commander /i      |
-   /Air Commodore /i      |
-   /Air Marshall /i       |
-   /Lieutenant Colonel /i |
-   /Lt\.? Col\.? /i       |
-   /Lt\.? Gen\.? /i       |
-   /Lt\.? Cdr\.? /i       |
-   /Lieutenant /i         |
-   /(Lt|Leut|Lieut)\.? /i |
-   /Major General /i      |
-   /Maj\.? Gen\.?/i       |
-   /Major /i              |
-   /Maj\.? /i             |
-   /Pilot Officer /i      |
+   /Brig(adier)? /i         |
+   /Captain /i              |
+   /Capt\.? /i              |
+   /Colonel /i              |
+   /Col\.? /i               |
+   /Commander in Chief /i   |
+   /Commander /i            |
+   /Commodore /i            |
+   /Cdr\.? /i               |   # Commander, Commodore
+   /Field Marshall /i       |
+   /Fl\.? Off\.? /i         |
+   /Flight Officer /i       |
+   /Flt Lt /i               |
+   /Flight Lieutenant /i    |
+   /General of the Army /i  |
+   /Gen(\.|eral)? /i        |
+   /Gen\. /i                |
+   /Pte\. /i                |
+   /Private /i              |
+   /Sgt\.? /i               |
+   /Sargent /i              |
+   /Air Commander /i        |
+   /Air Commodore /i        |
+   /Air Marshall /i         |
+   /Lieutenant Colonel /i   |
+   /Lt\.? Col\.? /i         |
+   /Lt\.? Gen\.? /i         |
+   /Lt\.? Cdr\.? /i         |
+   /Lieutenant /i           |
+   /(Lt|Leut|Lieut)\.? /i   |
+   /Major General /i        |
+   /Maj\.? Gen\.?/i         |
+   /Major /i                |
+   /Maj\.? /i               |
+   /Pilot Officer /i        |
 
 
    # Religious
-   /Rabbi /i              |
-   /Bishop /i             |
-   /Brother /i            |
-   /Chaplain /i           |
-   /Father /i             |
-   /Pastor /i             |
-   /Mother Superior /i    |
-   /Mother /i             |
-   /Most Rever[e|a]nd /i  |
-   /Very Rever[e|a]nd /i  |
-   /Rever[e|a]nd /i       |
-   /Mt\.? Revd\.? /i      |
-   /V\.? Revd?\.? /i      |
-   /Revd?\.? /i           |
+   /Rabbi /i             |
+   /Bishop /i            |
+   /Brother /i           |
+   /Chaplain /i          |
+   /Father /i            |
+   /Pastor /i            |
+   /Mother Superior /i   |
+   /Mother /i            |
+   /Most Rever[e|a]nd /i |
+   /Very Rever[e|a]nd /i |
+   /Rever[e|a]nd /i      |
+   /Mt\.? Revd\.? /i     |
+   /V\.? Revd?\.? /i     |
+   /Revd?\.? /i          |
 
 
    # Other
-   /Prof(\.|essor)? /i    |
+   /Prof(\.|essor)? /i   |
    /Ald(\.|erman)? /i
 };
 




More information about the Pkg-perl-cvs-commits mailing list