blib/lib/ArrayData/Lingua/Word/EN/Wordle.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package ArrayData::Lingua::Word::EN::Wordle;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 with 'ArrayDataRole::Source::LinesInDATA';
6 1 with 'ArrayDataRole::BinarySearch::LinesInHandle'; # add has_item() that uses binary search
7 1 with 'Role::TinyCommons::Collection::FindItem::Iterator'; # add find_item() (has_item already added above)
8 1 with 'Role::TinyCommons::Collection::PickItems::RandomSeekLines'; # add pick_items() that uses binary search
9  
10 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11 1 our $DATE = '2022-03-27'; # DATE
12 1 our $DIST = 'ArrayData-Lingua-Word-EN-Wordle'; # DIST
13 1 our $VERSION = '20220306.0.1'; # VERSION
14  
15 # STATS
16  
17 1 1;
18 # ABSTRACT: Wordle words (English)
19  
20 =pod
21  
22 =encoding UTF-8
23  
24 =head1 NAME
25  
26 ArrayData::Lingua::Word::EN::Wordle - Wordle words (English)
27  
28 =head1 VERSION
29  
30 This document describes version 20220306.0.1 of ArrayData::Lingua::Word::EN::Wordle (from Perl distribution ArrayData-Lingua-Word-EN-Wordle), released on 2022-03-27.
31  
32 =head1 SYNOPSIS
33  
34 use ArrayData::Lingua::Word::EN::Wordle;
35  
36 my $ary = ArrayData::Lingua::Word::EN::Wordle->new;
37  
38 # Iterate the elements
39 $ary->reset_iterator;
40 while ($ary->has_next_item) {
41 my $element = $ary->get_next_item;
42 ... # do something with the element
43 }
44  
45 # Another way to iterate
46 $ary->each_item(sub { my ($item, $obj, $pos) = @_; ... }); # return false in anonsub to exit early
47  
48 # Get elements by position (array index)
49 my $element = $ary->get_item_at_pos(0); # get the first element
50 my $element = $ary->get_item_at_pos(90); # get the 91th element, will die if there is no element at that position.
51  
52 # Get number of elements in the list
53 my $count = $ary->get_item_count;
54  
55 # Get all elements from the list
56 my @all_elements = $ary->get_all_items;
57  
58 # Find an item.
59 my @found = $ary->find_item(item => 'foo');
60 my $has_item = $ary->has_item('foo'); # bool
61  
62 # Pick one or several random elements.
63 my $element = $ary->pick_item;
64 my @elements = $ary->pick_items(n=>3);
65  
66 =head1 DESCRIPTION
67  
68 This is the list of words used in the Wordle[1] game, retrieved from its source
69 code. It can be used as a source of words for other writing games, or for doing
70 some analysis.
71  
72 =head1 HOMEPAGE
73  
74 Please visit the project's homepage at L<https://metacpan.org/release/ArrayData-Lingua-Word-EN-Wordle>.
75  
76 =head1 SOURCE
77  
78 Source repository is at L<https://github.com/perlancar/perl-ArrayData-Lingua-Word-EN-Wordle>.
79  
80 =head1 SEE ALSO
81  
82 [1] L<https://www.nytimes.com/games/wordle/index.html>
83  
84 This word list in L<WordList> form: L<WordList::EN::Wordle>.
85  
86 Other C<ArrayData::Lingua::Word::EN::*> like
87 L<ArrayData::Lingua::Word::EN::Enable>.
88  
89 Other C<ArrayData::Lingua::Word::*::Wordle> like
90 L<ArrayData::Lingua::Word::ID::Wordle> (a.k.a.
91 L<ArrayData::Lingua::Word::ID::Katla>).
92  
93 =head1 AUTHOR
94  
95 perlancar <perlancar@cpan.org>
96  
97 =head1 CONTRIBUTING
98  
99  
100 To contribute, you can send patches by email/via RT, or send pull requests on
101 GitHub.
102  
103 Most of the time, you don't need to build the distribution yourself. You can
104 simply modify the code, then test via:
105  
106 % prove -l
107  
108 If you want to build the distribution (e.g. to try to install it locally on your
109 system), you can install L<Dist::Zilla>,
110 L<Dist::Zilla::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
111 Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required
112 beyond that are considered a bug and can be reported to me.
113  
114 =head1 COPYRIGHT AND LICENSE
115  
116 This software is copyright (c) 2022 by perlancar <perlancar@cpan.org>.
117  
118 This is free software; you can redistribute it and/or modify it under
119 the same terms as the Perl 5 programming language system itself.
120  
121 =head1 BUGS
122  
123 Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=ArrayData-Lingua-Word-EN-Wordle>
124  
125 When submitting a bug or request, please include a test-file or a
126 patch to an existing test-file that illustrates the bug or desired
127 feature.
128  
129 =cut
130  
131 __DATA__
↑ Summary