Compare commits
10 Commits
963f7b2917
...
03da6f95f9
Author | SHA256 | Date | |
---|---|---|---|
03da6f95f9 | |||
|
3615eca17e | ||
f8ae5d3da0 | |||
1ac9be0c0c | |||
|
acaf775ff0 | ||
1baba149ae | |||
8e224df997 | |||
|
b8950e115c | ||
|
3fd5950fcb | ||
|
88f19cd98e |
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cdda8af318dd7ede518fe23f0aa53cba89752955c82a44a74e1eba2d48d678a2
|
||||
size 16238
|
3
WordList-0.7.11.tar.gz
Normal file
3
WordList-0.7.11.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:af900f3954900fd607c5da893456af7b0769b59e2d445476095cf0c1a0471cd0
|
||||
size 24819
|
@@ -1,3 +1,208 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Sep 26 03:08:58 UTC 2021 - Tina Müller <timueller+perl@suse.de>
|
||||
|
||||
- updated to 0.7.11
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.7.11 2021-09-21 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- [bugfix] pick(): Return a numeric value for each_word().
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 24 03:09:54 UTC 2021 - Tina Müller <timueller+perl@suse.de>
|
||||
|
||||
- updated to 0.7.10
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.7.10 2021-06-23 Released-By: PERLANCAR; Urgency: low
|
||||
- No spec changes.
|
||||
- [doc] Mention ArrayData (and HashData & TableData).
|
||||
0.7.9 2021-03-05 Released-By: PERLANCAR; Urgency: low
|
||||
- No spec changes.
|
||||
- [doc] Mention WordListRole::FromArray, fix module names in
|
||||
mentions.
|
||||
0.7.8 2021-02-23 Released-By: PERLANCAR; Urgency: medium
|
||||
- Add WordListRole::FromArray.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat May 1 03:10:02 UTC 2021 - Tina Müller <timueller+perl@suse.de>
|
||||
|
||||
- updated to 0.7.7
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.7.7 2021-01-28 Released-By: PERLANCAR; Urgency: low
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- [doc] Mention App::wordlist & App::WordListUtils.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 24 03:10:59 UTC 2020 - Tina Müller <timueller+perl@suse.de>
|
||||
|
||||
- updated to 0.7.6
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.7.6 2020-08-23 Released-By: PERLANCAR; Urgency: medium
|
||||
- Introduce @EXAMPLES.
|
||||
- Assign default value to params.
|
||||
- Tweak Abstract.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 25 03:16:19 UTC 2020 - Tina Müller <timueller+perl@suse.de>
|
||||
|
||||
updated to 0.7.5
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.7.5 2020-05-24 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- Split new() to WordListBase.
|
||||
|
||||
- [doc] Add more docs.
|
||||
|
||||
|
||||
0.7.4 2020-05-24 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- Improve reusability: abstract filehandle and original position in
|
||||
'fh' and 'fh_orig_pos' object attribute.
|
||||
|
||||
|
||||
0.7.3 2020-05-23 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- Implement each_word() in terms of first_word() and next_word() to
|
||||
reduce code duplication.
|
||||
|
||||
|
||||
0.7.2 2020-05-23 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- Add tests.
|
||||
|
||||
|
||||
0.7.1 2020-05-23 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- Use value from orig_class attribute to keep working when class/object
|
||||
is mixed with roles into another package.
|
||||
|
||||
- [doc] WordListRole::WordList: Document the required methods.
|
||||
|
||||
- [doc] Add FAQ item about pick() returning '1'.
|
||||
|
||||
- [doc] Remove mention of WordListMod::* modules.
|
||||
|
||||
|
||||
0.7.0 2020-05-22 Released-By: PERLANCAR; Urgency: medium; Backward-Compatible: no
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- [incompatible] Change storage of object from inflexible array to
|
||||
flexible hash.
|
||||
|
||||
|
||||
0.6.2 2020-05-22 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- No spec changes.
|
||||
|
||||
- pick(): Don't die when allow_duplicates is set to true.
|
||||
|
||||
|
||||
0.6.1 2020-05-22 Released-By: PERLANCAR; Urgency: medium
|
||||
|
||||
- Specify that user can now instruct pick() to allow duplicates, by
|
||||
setting the second argument to true.
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 5 03:16:46 UTC 2020 - Tina Müller <timueller+perl@suse.de>
|
||||
|
||||
updated to 0.6.0
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.6.0 2020-05-04 Released-By: PERLANCAR; Urgency: medium
|
||||
- Introduce parameterized wordlist; check for known and required
|
||||
param.
|
||||
|
||||
0.5.3 2020-05-04 Released-By: PERLANCAR; Urgency: medium
|
||||
- Add WordListRole::WordList, WordListRole::FirstNextResetFromEach,
|
||||
WordListRole::EachFromFirstNextReset.
|
||||
- Add tests for dynamic wordlist.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun May 3 03:12:49 UTC 2020 - Tina Müller <timueller+perl@suse.de>
|
||||
|
||||
updated to 0.5.2
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 6 06:42:54 UTC 2018 - coolo@suse.com
|
||||
|
||||
- updated to 0.4.1
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.4.1 2018-04-03 (PERLANCAR)
|
||||
- Define non-deterministic wordlist (DYNAMIC=2).
|
||||
- Remove todo list entries: no longer planned to provide random
|
||||
pick from a subset, already provide interface for faster lookup
|
||||
via WordList::Mod.
|
||||
|
||||
0.4.0 2018-04-02 (PERLANCAR)
|
||||
- Define dynamic wordlist.
|
||||
- Namespace: Add wordlist namespaces: WordList::Dynamic,
|
||||
WordList::Number.
|
||||
|
||||
0.3.2 2018-04-02 (PERLANCAR)
|
||||
- No spec changes.
|
||||
- Namespace: Replace WordList::Role::* with WordList::Mod::*.
|
||||
|
||||
0.3.1 2018-03-23 (PERLANCAR)
|
||||
- Add WordList::Bloom::* to non-wordlist namespace.
|
||||
- [dist] Activate DZP:WordList and PWP:WordList.
|
||||
|
||||
0.3.0 2018-03-22 (PERLANCAR)
|
||||
- Add WordList::Namespace.
|
||||
- [spec] each_word() will exit early if code returns -2.
|
||||
- [test] Add some tests.
|
||||
- [internal] Implement word_exists, pick, and all_words in terms of
|
||||
each_word(). Which is a tiny bit slower but more orthogonal and makes
|
||||
it easier to change functionality.
|
||||
|
||||
0.2.1 2018-03-19 (PERLANCAR)
|
||||
- [doc] Mention that there must not be duplicate entries.
|
||||
|
||||
0.2.0 2018-03-19 (PERLANCAR)
|
||||
- Allow wordlist to be sorted other than ascibetically, and in that
|
||||
case, require $SORT package variable to be set to some true value.
|
||||
- Move back implementation from WordListC (WordListC was an experiment
|
||||
and its feature is now incorporated into WordList).
|
||||
|
||||
0.1.5 2018-02-20 (PERLANCAR)
|
||||
- No spec changes.
|
||||
- [optimize] Avoid using base.pm.
|
||||
|
||||
0.1.4 2018-02-20 (PERLANCAR)
|
||||
- No spec changes.
|
||||
- [doc] Mention WordListC.
|
||||
- Move implementation to WordListC and make it our base module.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 20 07:10:37 UTC 2018 - coolo@suse.com
|
||||
|
||||
- updated to 0.1.3
|
||||
see /usr/share/doc/packages/perl-WordList/Changes
|
||||
|
||||
0.1.3 2018-02-20 (PERLANCAR)
|
||||
- No spec changes.
|
||||
- [doc] Remove warning label, some rewording in Description.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 25 07:10:51 UTC 2017 - coolo@suse.com
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package perl-WordList
|
||||
#
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -12,90 +12,98 @@
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: perl-WordList
|
||||
Version: 0.1.2
|
||||
Release: 0
|
||||
%define cpan_name WordList
|
||||
Summary: Word lists
|
||||
License: Artistic-1.0 or GPL-1.0+
|
||||
Group: Development/Libraries/Perl
|
||||
Url: http://search.cpan.org/dist/WordList/
|
||||
Name: perl-WordList
|
||||
Version: 0.7.11
|
||||
Release: 0
|
||||
Summary: Specification and base class for WordList::*, modules that contain word list
|
||||
License: Artistic-1.0 OR GPL-1.0-or-later
|
||||
URL: https://metacpan.org/release/%{cpan_name}
|
||||
Source0: https://cpan.metacpan.org/authors/id/P/PE/PERLANCAR/%{cpan_name}-%{version}.tar.gz
|
||||
Source1: cpanspec.yml
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: perl
|
||||
BuildRequires: perl-macros
|
||||
BuildRequires: perl(Role::Tiny)
|
||||
BuildRequires: perl(Role::Tiny::With)
|
||||
BuildRequires: perl(Test::Exception)
|
||||
BuildRequires: perl(Test::More) >= 0.98
|
||||
Requires: perl(Role::Tiny)
|
||||
Requires: perl(Role::Tiny::With)
|
||||
%{perl_requires}
|
||||
|
||||
%description
|
||||
*EARLY DEVELOPMENT, SPECIFICATION MIGHT STILL CHANGE CONSIDERABLY.*
|
||||
|
||||
'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 interface for Games::Word::Wordlist and
|
||||
'Games::Word::Wordlist::*'. Its main difference is: 'WordList::*' modules
|
||||
are read-only/immutable and designed to have low startup overhead. This
|
||||
makes it more suitable for use in CLI scripts which often only want to pick
|
||||
a word from one or several lists.
|
||||
'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.
|
||||
|
||||
Words (or phrases) must be put in __DATA__ section, *sorted*, one per line.
|
||||
By putting it in the __DATA__ section, perl doesn't have to parse the list.
|
||||
To search for words or picking some random words from the list, the module
|
||||
need not slurp the whole list into memory (and will not do so unless
|
||||
explicitly instructed.) Sorting must be asciibetical/by Unicode codepoint.
|
||||
This makes it more convenient to diff different versions of the module, as
|
||||
well as performing binary search.
|
||||
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).
|
||||
|
||||
Since this is a new and non-backward compatible interface from
|
||||
Games::Word::Wordlist, I also make some other changes:
|
||||
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').
|
||||
|
||||
* * Namespace is put outside 'Games::'
|
||||
There must not be any duplicate entry in the word list.
|
||||
|
||||
Because obviously word lists are not only useful for games.
|
||||
*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.
|
||||
|
||||
* * Interface is simpler
|
||||
*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.
|
||||
|
||||
This is partly due to the list being read-only. The methods provided are
|
||||
just:
|
||||
*Examples.* Examples can be specified in '@EXAMPLES' package variable. The
|
||||
structure is similar to Rinci function's 'examples' property. For example:
|
||||
|
||||
- 'pick' (pick one or several random entries)
|
||||
# in lib/WordList/Test/Dynamic/RandomWord/1000.pm
|
||||
|
||||
- 'word_exists' (check whether a word is in the list)
|
||||
|
||||
- 'each_word' (run code for each entry)
|
||||
|
||||
- 'all_words' (return all the words in a list)
|
||||
|
||||
A couple of other functions might be added, with careful consideration.
|
||||
|
||||
* * Namespace is more language-neutral and not English-centric
|
||||
|
||||
TODOS:
|
||||
|
||||
* * Interface for random pick from a subset
|
||||
|
||||
Pick $n words of length $L.
|
||||
|
||||
Pick $n words matching regex $re.
|
||||
|
||||
* * Interface to enable faster lookup/caching
|
||||
@EXAMPLES = (
|
||||
{
|
||||
summary => '1000 random words, each 10 to 15 characters long',
|
||||
args => {min_len=>10, max_len=>15},
|
||||
}
|
||||
);
|
||||
|
||||
%prep
|
||||
%setup -q -n %{cpan_name}-%{version}
|
||||
%autosetup -n %{cpan_name}-%{version}
|
||||
|
||||
%build
|
||||
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
||||
%{__make} %{?_smp_mflags}
|
||||
perl Makefile.PL INSTALLDIRS=vendor
|
||||
%make_build
|
||||
|
||||
%check
|
||||
%{__make} test
|
||||
make test
|
||||
|
||||
%install
|
||||
%perl_make_install
|
||||
@@ -103,7 +111,6 @@ Pick $n words matching regex $re.
|
||||
%perl_gen_filelist
|
||||
|
||||
%files -f %{name}.files
|
||||
%defattr(-,root,root,755)
|
||||
%doc Changes README
|
||||
%license LICENSE
|
||||
|
||||
|
Reference in New Issue
Block a user