Also close bug
[filters.git] / kenny
CommitLineData
b5b6bbbb 1#!/usr/bin/perl -w
2#
3# kenny.pl -- translate from and to KennySpeak
4#
5# $Revision: 1.7 $
6#
7# Licensed unter the Artistic License:
8# http://www.perl.com/language/misc/Artistic.html
9#
10# (C) 2001,2002 by Christian Garbs <mitch@cgarbs.de>, http://www.cgarbs.de
11# Alan Eldridge <alane@geeksrus.net>
12#
13# KennySpeak invented by Kohan Ikin <syneryder@namesuppressed.com>
14# http://www.namesuppressed.com/kenny/
15
16#
17# $Id: kenny.pl,v 1.7 2002/01/06 22:09:52 mitch Exp $
18#
19
20use strict;
21
22#
23# This is Perl POD documentation.
24# You can generate a nice manpage with "pod2man kenny.pl > kenny.man".
25# Or have a look at "perldoc perlpod" for other options
26#
27
28=head1 NAME
29
30kenny.pl -- translate from and to KennySpeak
31
32=head1 SYNOPSIS
33
34B<kenny.pl>
35S<[ B<-h> ]>
36S<[ B<-u> ]>
37S<[ B<-k> | B<-d> ]>
38S<[ I<file1> ] [ I<file2> ] ...>
39
40=head1 OVERVIEW
41
42kenny.pl translates a given text from or to B<KennySpeak>. KennySpeak
43looks like this:
44
45 "Ppfmfp ppmffm mfmppfmpm, fmpmfpmppffm'fpmmpp
46 pmpmffpmfpmfmppmpm Pmpmppppppppffm!"
47
48=head1 DESCRIPTION
49
50kenny.pl will read the given filenames, translate them and print the
51results on stdout. If you don't give a filename, stdin is used. A F<->
52as a filename means stdin.
53
54Without any parameters, kenny.pl will look at the first line of input
55and guess which way you want to translate. If kenny.pl guesses wrong,
56you must select the translation mode using the B<-k> or B<-d> switch.
57
58=head2 Switches
59
60=over 5
61
62=item B<-h>
63
64This will print a short notice and a quick summary of the available
65switches.
66
67=item B<-u>
68
69This will convert German umlauts to Ae, Oe, Ue, ae, oe, ue and ss
70so that they can be kennyfied correctly.
71
72=item B<-k>
73
74Kennyfy. This forces the input to be translated into KennySpeak.
75
76=item B<-d>
77
78Dekennyfy. This forces the input to be translated back from
79KennySpeak.
80
81=back
82
83=head1 VERSION
84
85This is $Revision: 1.7 $.
86
87=head1 BUGS
88
89The B<-u> switch might not work for charsets other than Latin-1. You
90might try to convert the kenny.pl script using B<recode> to change it
91from Latin-1 to your preferred charset.
92
93=head1 CREDITS
94
95kenny.pl was written by B<Christian Garbs>. Look on his homepage for
96newer versions of kenny.pl. Bug reports or comments about the program
97should be sent to him:
98 Christian Garbs <F<mitch@cgarbs.de>>
99 F<http://www.cgarbs.de/weird.en.html>
100
101KennySpeak was invented by B<Kohan Ikin>. See his homepage for an
102online version of the original B<KennyTranslator>:
103 Kohan Ikin <F<syneryder@namesuppressed.com>>
104 F<http://www.namesuppressed.com/kenny/>
105
106Alan Eldridge <F<alane@geeksrus.net>> patched in a signal handler to
107print an appropriate message when kenny.pl is killed.
108
109=head1 COPYRIGHT
110
111kenny.pl is licensed unter the B<Artistic License> which can be found
112at F<http://www.perl.com/language/misc/Artistic.html>. This license
113has been chosen for keeping compatibility with the original KennySpeak
114format.
115
116=cut
117
118
119
120######################################################################
121#
122# CHANGELOG
123#
124# $Log: kenny.pl,v $
125# Revision 1.7 2002/01/06 22:09:52 mitch
126# Included patch by Alan Eldridge <alane@geeksrus.net>
127# to show a message when kenny.pl is killed.
128#
129# Revision 1.6 2001/07/20 19:04:49 mitch
130# Removed warnings with Perl 5.6.
131# Thanks go to Alan Eldridge <alane@geeksrus.net>
132#
133# Revision 1.5 2001/07/15 10:27:57 mitch
134# Included notice about -u and charsets other than Latin-1.
135#
136# Revision 1.4 2001/07/14 13:16:30 mitch
137# Initial release.
138#
139#
140#
141######################################################################
142
143
144
145#
146# finally{}, the source code!
147#
148
149
150
151##### Declaration of function prototypes
152
153sub generateKenny();
154sub generateDeKenny($);
155sub guessDialect($);
156sub translate($);
157sub addGermanUmlauts($);
158sub printHelp();
159sub theyKilledKenny();
160
161
162
163##### Default values for various option:
164
165my $dialect = 0; # Translate from or to KennySpeak?
166 # 0=guess, 1=encode, 2=decode
167
168my $umlauts = 0; # Convert German Umlauts before translation?
169