Acme-Lingua-ZH-Remix
view release on metacpan or search on metacpan
NAME
Acme::Lingua::ZH::Remix - The Chinese sentence generator.
SYNOPSIS
use Acme::Lingua::ZH::Remix;
my $x = Acme::Lingua::ZH::Remix->new;
# Generate a random sentance
say $x->random_sentence;
DESCRIPTION
Because lipsum is not funny enough, that is the reason to write this
module.
This module is a Moo-based, with "new" method being the constructor.
The "random_sentence" method returns a string of one sentence of Chinese
like:
By default, it uses small corpus data from Project Gutenberg. The
generated sentences are remixes of the corpus.
You can feed you own corpus data to the `feed` method:
my $x = Acme::Lingua::ZH::Remix->new;
$x->feed($my_corpus);
# Say something based on $my_corpus
say $x->random_santence;
The corpus should use full-width punctuation characters.
METHODS
split_corpus($corpus_text)
Takes a scalar, returns an list.
This is an utility method that does not change the internal state of the
topic object.
lib/Acme/Lingua/ZH/Remix.pm view on Meta::CPAN
Acme::Lingua::ZH::Remix - The Chinese sentence generator.
=head1 SYNOPSIS
use Acme::Lingua::ZH::Remix;
my $x = Acme::Lingua::ZH::Remix->new;
# Generate a random sentance
say $x->random_sentence;
=head1 DESCRIPTION
Because lipsum is not funny enough, that is the reason to write this
module.
This module is a L<Moo>-based, with C<new> method being the constructor.
The C<random_sentence> method returns a string of one sentence
of Chinese like:
lib/Acme/Lingua/ZH/Remix.pm view on Meta::CPAN
By default, it uses small corpus data from Project Gutenberg. The generated
sentences are remixes of the corpus.
You can feed you own corpus data to the `feed` method:
my $x = Acme::Lingua::ZH::Remix->new;
$x->feed($my_corpus);
# Say something based on $my_corpus
say $x->random_santence;
The corpus should use full-width punctuation characters.
=cut
use utf8;
use Moo;
use Types::Standard qw(HashRef Int);
use List::MoreUtils qw(uniq);
use Hash::Merge qw(merge);
( run in 3.969 seconds using v1.01-cache-2.11-cpan-364913b4093 )