| 1 | package WordList::Phrase::ZH::Idiom::Wiktionary; | ||
| 2 | |||
| 3 | 1 | our $DATE = '2016-02-10'; # DATE | |
| 4 | 1 | our $VERSION = '0.02'; # VERSION | |
| 5 | |||
| 6 | 1 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | use WordList; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | our @ISA = qw(WordList); | |
| 10 | |||
| 11 | 1 | our %STATS = ("avg_word_len",4.44047619047619,"shortest_word_len",2,"num_words_contains_unicode",1008,"num_words_contains_nonword_chars",45,"num_words_contains_whitespace",0,"longest_word_len",14,"num_words",1008); # STATS | |
| 12 | |||
| 13 | 1 | 1; | |
| 14 | # ABSTRACT: Chinese idioms (chengyu) from wiktionary.org | ||
| 15 | |||
| 16 | =pod | ||
| 17 | |||
| 18 | =encoding UTF-8 | ||
| 19 | |||
| 20 | =head1 NAME | ||
| 21 | |||
| 22 | WordList::Phrase::ZH::Idiom::Wiktionary - Chinese idioms (chengyu) from wiktionary.org | ||
| 23 | |||
| 24 | =head1 VERSION | ||
| 25 | |||
| 26 | This document describes version 0.02 of WordList::Phrase::ZH::Idiom::Wiktionary (from Perl distribution WordList-Phrase-ZH-Idiom-Wiktionary), released on 2016-02-10. | ||
| 27 | |||
| 28 | =head1 SYNOPSIS | ||
| 29 | |||
| 30 | use WordList::Phrase::ZH::Idiom::Wiktionary; | ||
| 31 | |||
| 32 | my $wl = WordList::Phrase::ZH::Idiom::Wiktionary->new; | ||
| 33 | |||
| 34 | # Pick a (or several) random word(s) from the list | ||
| 35 | my $word = $wl->pick; | ||
| 36 | my @words = $wl->pick(3); | ||
| 37 | |||
| 38 | # Check if a word exists in the list | ||
| 39 | if ($wl->word_exists('foo')) { ... } | ||
| 40 | |||
| 41 | # Call a callback for each word | ||
| 42 | $wl->each_word(sub { my $word = shift; ... }); | ||
| 43 | |||
| 44 | # Get all the words | ||
| 45 | my @all_words = $wl->all_words; | ||
| 46 | |||
| 47 | =head1 DESCRIPTION | ||
| 48 | |||
| 49 | This module contains idioms from Wiktionary. Only simplified forms are included | ||
| 50 | here. | ||
| 51 | |||
| 52 | =head1 STATISTICS | ||
| 53 | |||
| 54 | +----------------------------------+------------------+ | ||
| 55 | | key | value | | ||
| 56 | +----------------------------------+------------------+ | ||
| 57 | | avg_word_len | 4.44047619047619 | | ||
| 58 | | longest_word_len | 14 | | ||
| 59 | | num_words | 1008 | | ||
| 60 | | num_words_contains_nonword_chars | 45 | | ||
| 61 | | num_words_contains_unicode | 1008 | | ||
| 62 | | num_words_contains_whitespace | 0 | | ||
| 63 | | shortest_word_len | 2 | | ||
| 64 | +----------------------------------+------------------+ | ||
| 65 | |||
| 66 | The statistics is available in the C<%STATS> package variable. | ||
| 67 | |||
| 68 | =head1 HOMEPAGE | ||
| 69 | |||
| 70 | Please visit the project's homepage at L<https://metacpan.org/release/WordList-Phrase-ZH-Idiom-Wiktionary>. | ||
| 71 | |||
| 72 | =head1 SOURCE | ||
| 73 | |||
| 74 | Source repository is at L<https://github.com/perlancar/perl-WordList-Phrase-ZH-Idiom-Wiktionary>. | ||
| 75 | |||
| 76 | =head1 BUGS | ||
| 77 | |||
| 78 | Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=WordList-Phrase-ZH-Idiom-Wiktionary> | ||
| 79 | |||
| 80 | When submitting a bug or request, please include a test-file or a | ||
| 81 | patch to an existing test-file that illustrates the bug or desired | ||
| 82 | feature. | ||
| 83 | |||
| 84 | =head1 SEE ALSO | ||
| 85 | |||
| 86 | L<https://en.wiktionary.org/w/index.php?title=Category:Chinese_idioms> | ||
| 87 | |||
| 88 | =head1 AUTHOR | ||
| 89 | |||
| 90 | perlancar <perlancar@cpan.org> | ||
| 91 | |||
| 92 | =head1 COPYRIGHT AND LICENSE | ||
| 93 | |||
| 94 | This software is copyright (c) 2016 by perlancar@cpan.org. | ||
| 95 | |||
| 96 | This is free software; you can redistribute it and/or modify it under | ||
| 97 | the same terms as the Perl 5 programming language system itself. | ||
| 98 | |||
| 99 | =cut | ||
| 100 | |||
| 101 | __DATA__ | ||