Compare commits

...

10 Commits

Author SHA256 Message Date
03da6f95f9 Accepting request 921763 from devel:languages:perl:autoupdate
- 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().

OBS-URL: https://build.opensuse.org/request/show/921763
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=12
2021-09-27 16:00:13 +00:00
Stephan Kulow
3615eca17e Accepting request 901656 from devel:languages:perl:autoupdate
- 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.

OBS-URL: https://build.opensuse.org/request/show/901656
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=11
2021-07-01 14:51:40 +00:00
f8ae5d3da0 Accepting request 890277 from devel:languages:perl:autoupdate
- 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.

OBS-URL: https://build.opensuse.org/request/show/890277
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=10
2021-05-04 09:26:44 +00:00
1ac9be0c0c Accepting request 828904 from devel:languages:perl:autoupdate
- 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.

OBS-URL: https://build.opensuse.org/request/show/828904
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=9
2020-08-24 16:03:09 +00:00
Lars Vogdt
acaf775ff0 Accepting request 808735 from devel:languages:perl:autoupdate
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.

OBS-URL: https://build.opensuse.org/request/show/808735
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=8
2020-05-28 22:26:56 +00:00
1baba149ae Remove blank lines and tab stops
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=7
2020-05-06 14:16:06 +00:00
8e224df997 Accepting request 800390 from devel:languages:perl:autoupdate
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.

OBS-URL: https://build.opensuse.org/request/show/800390
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=6
2020-05-06 14:13:23 +00:00
Stephan Kulow
b8950e115c Accepting request 799828 from devel:languages:perl:autoupdate
updated to 0.5.2
   see /usr/share/doc/packages/perl-WordList/Changes

OBS-URL: https://build.opensuse.org/request/show/799828
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=5
2020-05-04 05:13:59 +00:00
Stephan Kulow
3fd5950fcb Accepting request 593893 from devel:languages:perl:autoupdate
automatic update

OBS-URL: https://build.opensuse.org/request/show/593893
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=4
2018-04-10 05:23:22 +00:00
Stephan Kulow
88f19cd98e Accepting request 578256 from devel:languages:perl:autoupdate
automatic update

OBS-URL: https://build.opensuse.org/request/show/578256
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-WordList?expand=0&rev=3
2018-02-24 07:04:31 +00:00
4 changed files with 271 additions and 59 deletions

View File

@@ -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
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:af900f3954900fd607c5da893456af7b0769b59e2d445476095cf0c1a0471cd0
size 24819

View File

@@ -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

View File

@@ -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