ArrayData - Specification for ArrayData::*, modules that contains array data
0.2
This document describes version 0.2.3 of ArrayData (from Perl distribution ArrayData), released on 2021-05-18.
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::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 (base classes should be put in ArrayDataBase::*, roles in ArrayDataRole::*).
ArrayDataBase::*
ArrayDataRole::*
More specific subnamespaces for more specific types of elements:
ArrayData::String::*
Strings. (But please see other more specific names.)
ArrayData::Word::*
Dictionary word lists (further classified as (further classified in ArrayData::Word::LanguageCode::* e.g. ArrayData::Word::ID::KBBI). These are designed to replace old WordList::* modules.
ArrayData::Word::
::*
ArrayData::Phrase::*
Phrase lists. Designed to replace old WordList::Phrase::* modules.
WordList::Phrase::*
ArrayData::CPAN::*
Arrays related to CPAN. Designed to replace old WordList::Domain::* modules.
WordList::Domain::*
ArrayData::Domain::*
Domain names or suffixes. Designed to replace old WordList::Domain::* modules.
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::HTTP::* modules.
ArrayDataBase::* the base classes. ArrayDataBases::* are main module names for distributions that bundle multiple base classes.
ArrayDataBases::*
ArrayDataRole::* the roles. ArrayDataRoles::* are main module names for distributions that bundle multiple roles.
ArrayDataRoles::*
ArrayDataBundle::* are main module names for distributions that contain several ArrayData modules.
ArrayDataBundle::*
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.
Please report any bugs or feature requests on the bugtracker website https://github.com/perlancar/perl-ArrayData/issues
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.
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>
This software is copyright (c) 2021 by 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.
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.