r42813 - in /branches/upstream/libtext-greeking-perl: ./ current/ current/Changes current/MANIFEST current/META.yml current/Makefile.PL current/README current/lib/ current/lib/Text/ current/lib/Text/Greeking.pm current/test.pl

christine at users.alioth.debian.org christine at users.alioth.debian.org
Tue Aug 25 23:19:41 UTC 2009


Author: christine
Date: Tue Aug 25 23:19:35 2009
New Revision: 42813

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=42813
Log:
[svn-inject] Installing original source of libtext-greeking-perl

Added:
    branches/upstream/libtext-greeking-perl/
    branches/upstream/libtext-greeking-perl/current/
    branches/upstream/libtext-greeking-perl/current/Changes
    branches/upstream/libtext-greeking-perl/current/MANIFEST
    branches/upstream/libtext-greeking-perl/current/META.yml
    branches/upstream/libtext-greeking-perl/current/Makefile.PL
    branches/upstream/libtext-greeking-perl/current/README
    branches/upstream/libtext-greeking-perl/current/lib/
    branches/upstream/libtext-greeking-perl/current/lib/Text/
    branches/upstream/libtext-greeking-perl/current/lib/Text/Greeking.pm
    branches/upstream/libtext-greeking-perl/current/test.pl

Added: branches/upstream/libtext-greeking-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-greeking-perl/current/Changes?rev=42813&op=file
==============================================================================
--- branches/upstream/libtext-greeking-perl/current/Changes (added)
+++ branches/upstream/libtext-greeking-perl/current/Changes Tue Aug 25 23:19:35 2009
@@ -1,0 +1,7 @@
+Revision history for Perl extension Text::Greeking;
+
+0.11 Mar 13 2005
+	- Fixed botched distribution.
+
+0.1  Mar 13 2005
+	- Initial release into CPAN.

Added: branches/upstream/libtext-greeking-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-greeking-perl/current/MANIFEST?rev=42813&op=file
==============================================================================
--- branches/upstream/libtext-greeking-perl/current/MANIFEST (added)
+++ branches/upstream/libtext-greeking-perl/current/MANIFEST Tue Aug 25 23:19:35 2009
@@ -1,0 +1,7 @@
+Changes
+lib/Text/Greeking.pm
+Makefile.PL
+MANIFEST
+README
+test.pl
+META.yml                                Module meta-data (added by MakeMaker)

Added: branches/upstream/libtext-greeking-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-greeking-perl/current/META.yml?rev=42813&op=file
==============================================================================
--- branches/upstream/libtext-greeking-perl/current/META.yml (added)
+++ branches/upstream/libtext-greeking-perl/current/META.yml Tue Aug 25 23:19:35 2009
@@ -1,0 +1,9 @@
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         Text-Greeking
+version:      0.11
+version_from: lib/Text/Greeking.pm
+installdirs:  site
+requires:
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.12

Added: branches/upstream/libtext-greeking-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-greeking-perl/current/Makefile.PL?rev=42813&op=file
==============================================================================
--- branches/upstream/libtext-greeking-perl/current/Makefile.PL (added)
+++ branches/upstream/libtext-greeking-perl/current/Makefile.PL Tue Aug 25 23:19:35 2009
@@ -1,0 +1,7 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    'NAME'		=> 'Text::Greeking',
+    'VERSION_FROM'	=> 'lib/Text/Greeking.pm', # finds $VERSION
+);

Added: branches/upstream/libtext-greeking-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-greeking-perl/current/README?rev=42813&op=file
==============================================================================
--- branches/upstream/libtext-greeking-perl/current/README (added)
+++ branches/upstream/libtext-greeking-perl/current/README Tue Aug 25 23:19:35 2009
@@ -1,0 +1,19 @@
+Text::Greeking is a module for generating meaningless text
+that creates the illusion of the finished document. 
+
+INSTALLATION
+
+To install this module type the following:
+
+    perl Makefile.PL
+    make 
+    make test 
+    make install
+
+COPYRIGHT AND LICENCE
+
+The software is released under the Artistic License. The
+terms of the Artistic License are described at
+http://www.perl.com/language/misc/Artistic.html. Except
+where otherwise noted, Text::Greeking is Copyright
+2005, Timothy Appnel, tima at cpan.org. All rights reserved.

Added: branches/upstream/libtext-greeking-perl/current/lib/Text/Greeking.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-greeking-perl/current/lib/Text/Greeking.pm?rev=42813&op=file
==============================================================================
--- branches/upstream/libtext-greeking-perl/current/lib/Text/Greeking.pm (added)
+++ branches/upstream/libtext-greeking-perl/current/lib/Text/Greeking.pm Tue Aug 25 23:19:35 2009
@@ -1,0 +1,228 @@
+package Text::Greeking;
+use strict;
+use warnings;
+
+use vars qw( $VERSION );
+$VERSION = 0.11;
+
+# make controllable eventually.
+my @punc = split('', '..........??!');
+my @inpunc = split('',',,,,,,,,,,;;:');
+push @inpunc, ' --';
+
+sub new {
+    my $class =shift;
+    my $self = bless {}, $class;
+    srand;
+    $self->init;
+}
+
+sub init {
+    $_[0]->sources([]);
+    $_[0]->paragraphs(2,8);
+    $_[0]->sentences(2,8);
+    $_[0]->words(5,15);
+    $_[0];
+}
+
+sub sources { 
+    $_[0]->{sources} = $_[1] if defined $_[1];
+    $_[0]->{sources};
+}
+
+sub add_source {
+    my($self,$text) = @_;
+    return unless $text;
+    $text =~s/[\n\r]/ /g;
+    $text =~s/[[:punct:]]//g;
+    my @words = map { lc $_ } split /\s+/, $text;
+    push @{$self->{sources}}, \@words;
+}
+
+sub generate {
+    my $self = shift;
+    my $out;
+    $self->_load_default_source unless defined $self->{sources}->[0];
+    my @words = @{$self->{sources}->[int(rand(@{$self->{sources}}))]};
+    my($paramin,$paramax) = @{$self->{paragraphs}};
+    my($sentmin,$sentmax) = @{$self->{sentences}};
+    my($phramin,$phramax) = @{$self->{words}};
+    my $pcount = int(rand($paramax-$paramin+1)+$paramin);
+    for (my $x=0; $x < $pcount; $x++) {
+        my $p;
+        my $scount = int(rand($sentmax-$sentmin+1)+$sentmin);
+        for (my $y=0; $y < $scount; $y++) {
+            my $s;
+            my $wcount = int(rand($phramax-$phramin+1)+$phramin);
+            for (my $w=0; $w < $wcount; $w++) {
+                my $word = $words[int(rand(@words))];
+                $s .= $s ? " $word" : ucfirst($word); 
+                $s .= (($w+1 < $wcount) && !int(rand(10))) ? 
+                    $inpunc[int(rand(@inpunc))] : '';
+            }
+            $s .= $punc[int(rand(@punc))];
+            $p .= ' ' if $p;
+            $p .= $s;
+         }
+        $out .= $p."\n\n"; # assumes text.
+    }
+    $out;
+}
+
+sub paragraphs { $_[0]->{paragraphs} = [ $_[1], $_[2] ] }
+sub sentences { $_[0]->{sentences} = [ $_[1], $_[2] ] }
+sub words { $_[0]->{words} = [ $_[1], $_[2] ] }
+
+sub _load_default_source {
+    my $text = <<TEXT;
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
+sed diam nonummy nibh euismod tincidunt ut laoreet dolore
+magna aliquam erat volutpat. Ut wisi enim ad minim veniam,
+quis nostrud exerci tation ullamcorper suscipit lobortis
+nisl ut aliquip ex ea commodo consequat. Duis autem vel eum
+iriure dolor in hendrerit in vulputate velit esse molestie
+consequat, vel illum dolore eu feugiat nulla facilisis at
+vero eros et accumsan et iusto odio dignissim qui blandit
+praesent luptatum zzril delenit augue duis dolore te feugait
+nulla facilisi.
+Ut wisi enim ad minim veniam, quis nostrud exerci tation
+ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
+consequat. Duis autem vel eum iriure dolor in hendrerit in
+vulputate velit esse molestie consequat, vel illum dolore eu
+feugiat nulla facilisis at vero eros et accumsan et iusto
+odio dignissim qui blandit praesent luptatum zzril delenit
+augue duis dolore te feugait nulla facilisi. Lorem ipsum
+dolor sit amet, consectetuer adipiscing elit, sed diam
+nonummy nibh euismod tincidunt ut laoreet dolore magna
+aliquam erat volutpat. 
+Duis autem vel eum iriure dolor in hendrerit in vulputate
+velit esse molestie consequat, vel illum dolore eu feugiat
+nulla facilisis at vero eros et accumsan et iusto odio
+dignissim qui blandit praesent luptatum zzril delenit augue
+duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit
+amet, consectetuer adipiscing elit, sed diam nonummy nibh
+euismod tincidunt ut laoreet dolore magna aliquam erat
+volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci
+tation ullamcorper suscipit lobortis nisl ut aliquip ex ea
+commodo consequat.
+TEXT
+    $_[0]->add_source($text);
+}
+
+1;
+
+__END__
+
+=begin
+
+=head1 NAME
+
+Text::Greeking - a module for generating meaningless text
+that creates the illusion of the finished document. 
+
+=head1 SYNOPSIS
+
+ #!/usr/bin/perl -w
+ use strict;
+ 
+ use Text::Greeking;
+ 
+ my $g = Text::Greeking->new;
+ $g->paragraphs(1,2) # min of 1 paragraph and a max of 2
+ $g->sentences(2,5) # min of 2 sentences per paragraph and a max of 5
+ $g->words(8,16) # min of 8 words per sentence and a max of 16
+ print $g->generate; # use default Lorem Ipsum source
+  
+=head1 DESCRIPTION
+
+Greeking is the use of random letters or marks to show the
+overall appearance of a printed page without showing the
+actual text. Greeking is used to make it easy to judge the
+overall appearance of a document without being distracted by
+the meaning of the text.
+
+This is a module is for quickly generating varying
+meaningless text from any source to create this illusion of
+the content in systems.
+
+This module was created to quickly give developers simulated
+content to fill systems with simulated content. Instead of
+static Lorem Ipsum text, by using randomly generated text
+and optionally varying word sources, repetitive and
+monotonous patterns that do not represent real system usage
+is avoided. 
+
+=head1 METHODS
+
+=over
+
+=item Text::Greeking->new
+
+Constructor method. Returns a new instance of the class.
+
+=item $g->sources([\@ARRAY])
+
+Gets/sets the table of source word collections current in
+memory as an ARRAY reference
+
+=item $g->add_source($text)
+
+The class takes a body of text passed as a SCALAR and
+processes it into a list of word tokens for use in
+generating random filler text later.
+
+=item $g->generate
+
+Returns a body of random text generated from a randomly
+selected source using the minimum and maximum values set by
+paragraphs, sentences, and words minimum and maximum values.
+If generate is called without any sources a standard Lorem
+Ipsum block is used added to the sources and then used for
+processing the random text.
+
+=item $g->paragraphs($min,$max)
+
+Sets the minimum and maximum number of paragraphs to
+generate. Default is a minimum of 2 and a maximum of 8.
+
+=item $g->sentences($min,$max)
+
+Sets the minimum and maximum number of sentences to generate
+per paragraph. Default is a minimum of 2 and a maximum of 8.
+
+=item $g->words($min,$max)
+
+Sets the minimum and maximum number of words to generate per
+sentence. Default is a minimum of 5 and a maximum of 15.
+
+=back
+
+=head1 SEE ALSO
+
+http://en.wikipedia.org/wiki/Greeking
+
+=head1 TO DO
+
+=over
+
+=item HTML output mode including random hyperlinked phrases.
+
+=item Configurable punctuation controls.
+
+=back
+
+=head1 LICENSE
+
+The software is released under the Artistic License. The
+terms of the Artistic License are described at
+L<http://www.perl.com/language/misc/Artistic.html>.
+
+=head1 AUTHOR & COPYRIGHT
+
+Except where otherwise noted, Text::Greeking is 
+Copyright 2005, Timothy Appnel, tima at cpan.org. All rights 
+reserved.
+
+=cut
+
+=end

Added: branches/upstream/libtext-greeking-perl/current/test.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-greeking-perl/current/test.pl?rev=42813&op=file
==============================================================================
--- branches/upstream/libtext-greeking-perl/current/test.pl (added)
+++ branches/upstream/libtext-greeking-perl/current/test.pl Tue Aug 25 23:19:35 2009
@@ -1,0 +1,19 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..1\n"; }
+END {print "not ok 1\n" unless $loaded;}
+use Text::Greeking;
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):




More information about the Pkg-perl-cvs-commits mailing list