ArrayData - Specification for ArrayData::*, modules that contains array data
0.2
This document describes version 0.2.5 of ArrayData (from Perl distribution ArrayData), released on 2021-12-01.
Use one of the ArrayData::* modules.
ArrayData::*
NOTE: EARLY SPECIFICATION; THINGS WILL STILL CHANGE A LOT.
ArrayData::* modules are modules that contain array data. The array can be stored in an actual Perl array in the source code, or as lines in the DATA section of the source code, or in other places. The array data can be accessed via a standard interface (see ArrayDataRole::Spec::Basic). Some examples of array data are:
list of country names in English (ArrayData::CountryName::EN)
list of Indonesian words from KBBI dictionary (ArrayData::Lingua::Word::ID::KBBI)
Also under WordList::ID::KBBI.
list of CPAN authors' PAUSE ID's (ArrayData::CPAN::PAUSEID)
Also under WordList::CPAN::PAUSEID.
Why put data in a Perl module, as a Perl distribution? To leverage the Perl/CPAN toolchain and infrastructure: 1) ease of installation, update, and uninstallation; 2) allowing dependency expression and version comparison; 3) ease of packaging further as OS packages, e.g. Debian packages (converted from Perl distribution); 4) testing by CPAN Testers.
To get started, see ArrayDataRole::Spec::Basic and one of existing ArrayData::* modules.
ArrayData (this module) is the specification.
ArrayData
All the modules under ArrayData::* should be modules with actual data.
More specific subnamespaces for more specific topics and/or types of elements:
ArrayData::Lingua::*
See also: TableData::Lingua::*.
TableData::Lingua::*
ArrayData::Lingua::Word::*
Dictionary word lists (further classified as (further classified in ArrayData::Lingua::Word::LanguageCode::* e.g. ArrayData::Lingua::Word::ID::KBBI). These are designed to replace old WordList::* modules.
ArrayData::Lingua::Word::
::*
See also: TableData::Lingua::Word::*.
TableData::Lingua::Word::*
ArrayData::Lingua::Phrase::*
Phrase lists. Designed to replace old WordList::Phrase::* modules.
WordList::Phrase::*
See also: TableData::Lingua::Phrase::*.
TableData::Lingua::Phrase::*
ArrayData::CPAN::*
Arrays related to CPAN. Designed to replace old WordList::CPAN::* modules.
WordList::CPAN::*
See also: TableData::CPAN::*.
TableData::CPAN::*
ArrayData::Domain::*
Domain names or suffixes. Designed to replace old WordList::Domain::* modules.
WordList::Domain::*
ArrayData::HTTP::*
HTTP-related array data. Designed to replace old WordList::HTTP::* modules.
WordList::HTTP::*
ArrayData::Number::*
Numbers.
ArrayData::Password::*
Passwords. Designed to replace old WordList::Password::* modules.
WordList::Password::*
ArrayDataBundle::* are main module names for distributions that contain several ArrayData modules.
ArrayDataBundle::*
ArrayDataBase::* are the base classes. ArrayDataBases::* are main module names for distributions that bundle multiple base classes. Since ArrayData is largely role-based, it is expected that we do not have many of these base classes.
ArrayDataBase::*
ArrayDataBases::*
ArrayDataBases::* are main module names for distributions that bundle multiple base classes.
ArrayDataRole::* are the roles.
ArrayDataRole::*
ArrayDataRoles::* are main module names for distributions that bundle multiple roles.
ArrayDataRoles::*
ArrayDataRole::* are for other utility modules related to ArrayData.
ArrayDataUtils::* are main module names for distributions that bundle multiple ArrayDataUtil::* modules.
ArrayDataUtils::*
ArrayDataUtil::*
Both are okay. If you prefer WordList then by all means use it. Existing WordList::* modules will stay. WordList's API is now frozen. New development and updates to word lists will happen mostly in ArrayData only.
Method names:
Function In WordList In ArrayData -------- ----------- ------------ iterating words each_word() each_item() (from Role::TinyCommons::Iterator::Resettable) reset_iterator() + first_word() + next_word() reset_iterator() + has_next_item() + get_next_item() (from Role::TinyCommons::Iterator::Resettable) checking if a word exists word_exists() has_item() (from Role::TinyCommons::Collection::FindItem) getting all words all_words() get_all_items() (from Role::TinyCommons::Iterator::Resettable) picking random words pick() pick_items() (from Role::TinyCommons::Collection::PickItems)
Additional roles:
Function In WordList In ArrayData -------- ----------- ------------ Binary search WordListRole::BinarySearch ArrayDataRole::BinarySearch::LinesInHandle Bloom filter WordListRole::Bloom ArrayDataRole::Bloom
Please visit the project's homepage at https://metacpan.org/release/ArrayData.
Source repository is at https://github.com/perlancar/perl-ArrayData.
HashData, TableData are related projects.
WordList is an older, related project. ArrayData and its sister projects HashData & TableData are a generalization and cleanup of the WordList API.
perlancar <perlancar@cpan.org>
To contribute, you can send patches by email/via RT, or send pull requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required beyond that are considered a bug and can be reported to me.
This software is copyright (c) 2021 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=ArrayData
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
To install ArrayData, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ArrayData
CPAN shell
perl -MCPAN -e shell install ArrayData
For more information on module installation, please visit the detailed CPAN module installation guide.