View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Ron Savage > Lingua-EN-GivenNames-1.04 > Lingua::EN::GivenNames::Database



Annotate this POD

View/Report Bugs
Module Version: 1.01   Source  


Lingua::EN::GivenNames::Database - An SQLite database of derivations of English given names

Synopsis ^

See "Synopsis" in Lingua::EN::GivenNames for a long synopsis.

See also "How do the scripts and modules interact to produce the data?" in Lingua::EN::GivenNames.

Description ^

Documents the methods end-users need to access the SQLite database, lingua.en.givennames.sqlite, which ships with this distro.

See "Description" in Lingua::EN::GivenNames for a long description. See also scripts/*.pl.

Distributions ^

This module is available as a Unix-style distro (*.tgz).

See for details.

See for help on unpacking and installing.

Constructor and initialization ^

new(...) returns an object of type Lingua::EN::GivenNames::Database.

This is the class's contructor.

Usage: Lingua::EN::GivenNames::Database -> new().

This method takes a hash of options.

Call new() as new(option_1 => value_1, option_2 => value_2, ...).

Available options:

o attributes => $hash_ref

This is the hashref of attributes passed to DBI's connect() method.

Default: {AutoCommit => 1, RaiseError => 1, sqlite_unicode => 1}

o name => $string

Used to specify a given name which scripts/ uses as a key into the database.

Default: ''.

See "report_name([$name])" below for sample code.

Methods ^

This module is a sub-class of Lingua::EN::GivenNames and consequently inherits its methods.


Get or set the hashref of attributes passes to DBI's connect() method.

Also, attributes is an option to "new()".


Returns the result of: 'select count(*) from names'.


Returns a hashref where the keys are the English singluar versions of the names of the table, and the values are the actual table names.


Returns a hashref whose keys are the table names as returned by sub get_table_names().

The values for these keys are hashrefs of all the data in the corresponding table, as returned by DBIx::Table2Hash's select_hashref() method.

These nested hashrefs are keys by the primary key (integer) of each table.

Consequently, get_tables() returns all data for all tables.

See the source code for sub read_names_table() for how to access such data.


Gets and sets the name attribute, as used by scripts/

Also, name is an option to "new()".


See "Constructor and initialization".


Returns a hashref of the number of web pages dedicated to female and male names:

                female => 20,
                male   => 17,

Used by Lingua::EN::GivenNames::Database::Download.


Returns an arrayref of hashrefs of names, sorted by fc_name.

Each element in @$names contains data for 1 record in the database, and has these keys (in alphabetical order):

                derivation => The derivation,
                fc_name    => The case-folded name,
                form       => The form,
                id         => The primary key of this record,
                kind       => The kind,
                meaning    => The meaning,
                name       => The name,
                original   => The original (name),
                rating     => The rating (relability indicator),
                sex        => The sex,
                source     => The source (language or name),

This is discussed further in "Basic Usage" in Lingua::EN::GivenNames and "FAQ" in Lingua::EN::GivenNames.


Here, [] indicate an optional parameter.

Prints the result of searching the names table for a name specified either with the $name parameter, or via the name parameter to "new()".

Sample usage:

        perl scripts/ -n Zoe
        derivation  Greek name, meaning "life"
        fc_name     zoe
        form        name
        id          3962
        kind        Greek
        meaning     "life"
        name        Zoe
        original    -
        rating      meaning
        sex         female
        source      -


Currently prints these database statistics:

        Table            Records
        derivations         3062
        forms                 15
        kinds                 52
        meanings            1356
        names               3967
        originals           2393
        ratings                5
        sexes                  2
        sources               56


This uses Lingua::EN::StopWordList to report any stop words which happened to be picked up by the regexps used to parse the web page data.

Currently prints this report:

        Table 'sources' contains these stop words: of
        Table 'forms' contains these stop words: from, name


For the database schema, etc, see "FAQ" in Lingua::EN::GivenNames.

References ^

See "References" in Lingua::EN::GivenNames.

Support ^

Email the author, or log a bug on RT:

Author ^

Lingua::EN::GivenNames was written by Ron Savage <> in 2012.

Home page:

Copyright ^

Australian copyright (c) 2012 Ron Savage.

        All Programs of mine are 'OSI Certified Open Source Software';
        you can redistribute them and/or modify them under the terms of
        The Artistic License, a copy of which is available at:
syntax highlighting: