App-wordstat

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    This document describes version 0.003 of App::wordstat (from Perl
    distribution App-wordstat), released on 2020-10-11.

DESCRIPTION
    See included script wordstat.

FUNCTIONS
  wordstat
    Usage:

     wordstat(%args) -> [status, msg, payload, meta]

    Return word statistics of a text.

    Examples:

    *   Example #1:

         wordstat(text => "An optimistic person sees good things everywhere, is generally confident and\nhopeful of what the future holds. From the optimist's point-of-view the world is\nfull of potential opportunities. The pessimist, on the other ha...

        Result:

         [
           200,
           "OK (envelope generated)",
           {
             avg_line_len                  => 56,
             avg_line_with_words_len       => 70,
             avg_nonempty_line_len         => 70,

README  view on Meta::CPAN

             num_lines_with_words          => 4,
             num_nonempty_lines            => 4,
             num_unique_words              => 36,
             num_words                     => 45,
             shortest_word_len             => 1,
           },
         ]

    *   Supply text from file or stdin:

         wordstat( text => "file.txt");

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   text* => *str*

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200

lib/App/wordstat.pm  view on Meta::CPAN


See included script L<wordstat>.

=head1 FUNCTIONS


=head2 wordstat

Usage:

 wordstat(%args) -> [status, msg, payload, meta]

Return word statistics of a text.

Examples:

=over

=item * Example #1:

 wordstat(text => "An optimistic person sees good things everywhere, is generally confident and\nhopeful of what the future holds. From the optimist's point-of-view the world is\nfull of potential opportunities. The pessimist, on the other hand, obse...

Result:

 [
   200,
   "OK (envelope generated)",
   {
     avg_line_len                  => 56,
     avg_line_with_words_len       => 70,
     avg_nonempty_line_len         => 70,

lib/App/wordstat.pm  view on Meta::CPAN

     num_lines_with_words          => 4,
     num_nonempty_lines            => 4,
     num_unique_words              => 36,
     num_words                     => 45,
     shortest_word_len             => 1,
   },
 ]

=item * Supply text from file or stdin:

 wordstat( text => "file.txt");

=back

This function is not exported.

Arguments ('*' denotes required arguments):

=over 4

=item * B<text>* => I<str>



( run in 0.998 second using v1.01-cache-2.11-cpan-49f99fa48dc )