NAME

Lingua::EN::GivenNames::Database::Export - 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 export the SQLite database, lingua.en.givennames.sqlite, which ships with this distro, as either CSV or HTML.

See scripts/export.pl. The output of this script is shipped as:

o data/given.names.csv
o data/given.names.html

The latter file is on-line at: http://savage.net.au/Perl-modules/html/given.names.html.

Note: The on-line version was created with export.pl's jquery switch set to 1.

Distributions

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

See http://savage.net.au/Perl-modules.html for details.

See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing.

Constructor and initialization

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

This is the class's contructor.

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

This method takes a hash of options.

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

Available options (these are also methods):

o names_file => $a_csv_file_name

Specify the name of the CSV file to which given name data is exported.

Default: ''.

o web_page_file => $a_html_file_name

Specify the name of the HTML file to which given name data is exported.

See htdocs/assets/templates/locale/givennames/en/given.names.tx for the web page template used.

*.tx files are processed with Text::Xslate.

Default: ''.

Methods

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

as_csv([$file_name])

Here, [] indicate an optional parameter.

Export the SQLite database to the CSV file named either with the $file_name parameter or with the csv_file parameter to "new()".

Returns 0 to indicate success.

as_html([$file_name])

Here, [] indicate an optional parameter.

Export the SQLite database to the HTML file named either with the $file_name parameter or with the web_page_file parameter to "new()".

Returns 0 to indicate success.

build_name_data()

Builds the rows of a HTML table, and returns an arrayref of arrayrefs of hashrefs suitable for Text::Xslate.

csv_file($file_name)

Get or set the name of the CSV file to which given name data is exported.

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

export()

Calls as_csv() if the csv_file option was passed to "new()", or calls as_html() if the web_page_file option was passed to "new()". Dies if neither of those options was passed.

Returns 0 to indicate success.

new()

See "Constructor and initialization".

web_page_file($file_name)

Get or set the name of the HTML file to which given name data is exported.

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

FAQ

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:

https://rt.cpan.org/Public/Dist/Display.html?Name=Lingua::EN::GivenNames.

Author

Lingua::EN::GivenNames was written by Ron Savage <ron@savage.net.au> in 2012.

Home page: http://savage.net.au/index.html.

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:
http://www.opensource.org/licenses/index.html