Name : perl-WordList
| |
Version : 0.7.11
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp155.1.1
| Date : 2023-07-20 18:31:44
|
Group : Unspecified
| Source RPM : perl-WordList-0.7.11-lp155.1.1.src.rpm
|
Size : 0.10 MB
| |
Packager : https://www_suse_com/
| |
Summary : Specification and base class for WordList::*, modules that contain word list
|
Description :
\'WordList::*\' modules are modules that contain, well, list of words. This module, \'WordList\', serves as a base class and establishes convention for such modules.
\'WordList\' is an alternative for Games::Word::Wordlist and \'Games::Word::Wordlist::*\'. Its main difference is: \'WordList::*\' wordlists are read-only/immutable and the modules are designed to have low startup overhead. This makes them more suitable for use in CLI scripts which often only want to pick a word from one or several lists. See \"DIFFERENCES WITH GAMES::WORD::WORDLIST\" for more details.
Unless you are defining a dynamic wordlist (see below), words (or phrases) must be put in \'__DATA__\' section, one per line. Putting the wordlist in the \'__DATA__\' section relieves perl from having to parse the list during the loading of the module. To search for words or picking some random words from the list, the module also need not slurp the whole list into memory (and will not do so unless explicitly instructed).
You must sort your words ascibetically (or by Unicode code point). Sorting makes it more convenient to diff different versions of the module, as well as performing binary search. If you have a different sort order other than ascibetical, you must set package variable \'$SORT\' with some true value (say, \'frequency\').
There must not be any duplicate entry in the word list.
*Dynamic and non-deterministic wordlist.* A dynamic wordlist must set package variable \'$DYNAMIC\' to either 1 (deterministic) or 2 (non-deterministic). A dynamic wordlist does not put the wordlist in the DATA section; instead, user relies on \'first_word()\' + \'next_word()\', or \'each_word()\', or \'all_words()\' to get the list. A deterministic wordlist returns the same list everytime \'each_word()\' or \'all_words()\' is called. A non-deterministic list can return a different list for a different \'each_word()\' or \'all_words()\' call. See WordListRole::FirstNextResetFromEach, WordListRole::EachFromFirstNextReset, WordListRole::FromArray if you want to write a dynamic wordlist module. It is possible for a dynamic list to return unordered or duplicate entries, but it is not encouraged.
*Parameterized wordlist.* When instantiating a wordlist class instance, user can pass a list of key-value pairs as parameters. Normally only a dynamic wordlist would accept parameters. Parameters are defined in the \'%PARAMS\' package variable. It is a hash of parameter names as keys and parameter specification as values. Parameter specification follows function argument metadata specified in Rinci::function.
*Examples.* Examples can be specified in \'AATTEXAMPLES\' package variable. The structure is similar to Rinci function\'s \'examples\' property. For example:
AATTEXAMPLES = ( { summary => \'1000 random words, each 10 to 15 characters long\', args => {min_len=>10, max_len=>15}, } );
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-W/15.5/noarch |