summaryrefslogtreecommitdiff
path: root/lib/Locale/Maketext
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-20 18:45:00 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-20 18:45:00 +0000
commitff5ad48a406d02420ef1036954fc4b1323a7f781 (patch)
treef7c8bc9c94e6c2fa93cb65c8ac6f45b15558a1d6 /lib/Locale/Maketext
parentaf8cb43fb9598c55d1884437891d625d31e313bb (diff)
downloadperl-ff5ad48a406d02420ef1036954fc4b1323a7f781.tar.gz
Upgrade to Locale::Maketext 1.02, from Sean Burke.
p4raw-id: //depot/perl@10762
Diffstat (limited to 'lib/Locale/Maketext')
-rw-r--r--lib/Locale/Maketext/ChangeLog21
-rw-r--r--lib/Locale/Maketext/README70
-rw-r--r--lib/Locale/Maketext/TPJ13.pod2
-rw-r--r--lib/Locale/Maketext/test.pl61
4 files changed, 153 insertions, 1 deletions
diff --git a/lib/Locale/Maketext/ChangeLog b/lib/Locale/Maketext/ChangeLog
new file mode 100644
index 0000000000..e85ed6e0c3
--- /dev/null
+++ b/lib/Locale/Maketext/ChangeLog
@@ -0,0 +1,21 @@
+Revision history for Perl suite Locale::Maketext
+ Time-stamp: "2001-06-20 02:14:35 MDT"
+
+2001-06-20 Sean M. Burke sburke@cpan.org
+ * Release 1.02: EBCDIC-compatability changes courtesy of Peter
+ Prymmer. Added [*,...] as alias for [quant,...] and [#,...] as an
+ alias for [numf,...]. Added some more things to test.pl
+
+2001-05-25 Sean M. Burke sburke@cpan.org
+ * Release 1.01: total rewrite. Docs are massive now.
+ Including TPJ13 article now.
+
+2000-05-14 Sean M. Burke sburke@cpan.org
+
+ * Release 0.18: only change, regrettably, is a better makefile,
+ and it my email address has changed.
+
+1999-03-15 Sean M. Burke sburke@netadventure.net
+
+ * Release 0.17: Public alpha release
+ Underdocumented.
diff --git a/lib/Locale/Maketext/README b/lib/Locale/Maketext/README
new file mode 100644
index 0000000000..dd966119d4
--- /dev/null
+++ b/lib/Locale/Maketext/README
@@ -0,0 +1,70 @@
+README for Locale::Maketext
+ Time-stamp: "2001-05-25 08:15:55 MDT"
+
+ Locale::Maketext
+
+Locale::Maketext is a base class providing a framework for
+localization and inheritance-based lexicons, as described in my
+article in The Perl Journal #13 (a corrected version of which appears
+in this dist).
+
+This is a complete rewrite from the basically undocumented 0.x
+versions.
+
+
+
+PREREQUISITES
+
+This suite requires Perl 5. It also requires a recent version
+of I18N::LangTags. MSWin users should also get Win32::Locale.
+File::Findgrep is also useful example code.
+
+
+INSTALLATION
+
+You install Locale::Maketext, as you would install any Perl module
+distribution, by running these commands:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+If you want to install a private copy of Maketext in your home directory,
+then you should try to produce the initial Makefile with something
+like this command:
+
+ perl Makefile.PL LIB=~/perl
+
+See perldoc perlmodinstall for more information.
+
+
+DOCUMENTATION
+
+See the pod in Locale::Maketext and Locale::Maketext::TPJ13,
+and see also File::Findgrep.
+
+
+SUPPORT
+
+Questions, bug reports, useful code bits, and suggestions for
+Worms should be sent to me at sburke@cpan.org
+
+
+AVAILABILITY
+
+The latest version of Locale::Maketext is available from the
+Comprehensive Perl Archive Network (CPAN). Visit
+<http://www.perl.com/CPAN/> to find a CPAN site near you.
+
+
+COPYRIGHT
+
+Copyright 1999-2001, Sean M. Burke <sburke@cpan.org>, all rights
+reserved. This program is free software; you can redistribute it
+and/or modify it under the same terms as Perl itself.
+
+
+AUTHOR
+
+Sean M. Burke <sburke@cpan.org>
diff --git a/lib/Locale/Maketext/TPJ13.pod b/lib/Locale/Maketext/TPJ13.pod
index db22478215..5c2f28cab4 100644
--- a/lib/Locale/Maketext/TPJ13.pod
+++ b/lib/Locale/Maketext/TPJ13.pod
@@ -677,7 +677,7 @@ quantification is not as complicated an operation.
=head2 The Devil in the Details
There's plenty more to Maketext than described above -- for example,
-there's the details of how language tags ("en-US", "x-cree", "fi",
+there's the details of how language tags ("en-US", "i-pwn", "fi",
etc.) or locale IDs ("en_US") interact with actual module naming
("BogoQuery/Locale/en_us.pm"), and what magic can ensue; there's the
details of how to record (and possibly negotiate) what character
diff --git a/lib/Locale/Maketext/test.pl b/lib/Locale/Maketext/test.pl
new file mode 100644
index 0000000000..1a29da359b
--- /dev/null
+++ b/lib/Locale/Maketext/test.pl
@@ -0,0 +1,61 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+# Time-stamp: "2001-06-20 02:12:53 MDT"
+######################### We start with some black magic to print on failure.
+
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..5\n"; }
+END {print "fail 1\n" unless $loaded;}
+use Locale::Maketext 1.01;
+print "# Perl v$], Locale::Maketext v$Locale::Maketext::VERSION\n";
+$loaded = 1;
+print "ok 1\n";
+{
+ package Woozle;
+ @ISA = ('Locale::Maketext');
+ sub dubbil { return $_[1] * 2 }
+ sub numerate { return $_[2] . 'en' }
+}
+{
+ package Woozle::elx;
+ @ISA = ('Woozle');
+ %Lexicon = (
+ 'd2' => 'hum [dubbil,_1]',
+ 'd3' => 'hoo [quant,_1,zaz]',
+ 'd4' => 'hoo [*,_1,zaz]',
+ );
+}
+
+$lh = Woozle->get_handle('elx');
+if($lh) {
+ print "ok 2\n";
+
+ my $x;
+
+ $x = $lh->maketext('d2', 7);
+ if($x eq "hum 14") {
+ print "ok 3\n";
+ } else {
+ print "fail 3 # (got \"$x\")\n";
+ }
+
+ $x = $lh->maketext('d3', 7);
+ if($x eq "hoo 7 zazen") {
+ print "ok 4\n";
+ } else {
+ print "fail 4 # (got \"$x\")\n";
+ }
+
+ $x = $lh->maketext('d4', 7);
+ if($x eq "hoo 7 zazen") {
+ print "ok 5\n";
+ } else {
+ print "fail 5 # (got \"$x\")\n";
+ }
+
+
+} else {
+ print "fail 2\n";
+}
+#Shazam!