Lingua::Pangram - Is this string a pangram


Lingua-Pangram documentation  | view source Contained in the Lingua-Pangram distribution.

Index


SYNOPSIS

Top

  use Lingua::Pangram;
  my $pan = Lingua::Pangram->new;
  print "is a pangram" if $pan->pangram("a string");

  # alternative alphabet
  # add a" o" u" sz
  my $german = Lingua::Pangram->new(
                 [ 'a' .. 'z', "\xe4", "\xf6", "\xfc", "\xdf" ]
               );
  print "is a German pangram" if
    $german->pangram("eine Zeichenkette");

DESCRIPTION

Top

This module exports no functions. It has an object-oriented interface with one method: pangram. This method takes a string and returns 1 if the string passed in contains all the letters of the alphabet, otherwise it returns 0.

It is possible to change the notion of what comprises "all the letters of the alphabet" by passing in an alternative set to the ->new method as a reference to an array containing all possible (lowercase) letters. The default set is 'a' .. 'z'.

The pangram method will lowercase the string prior to testing for the letters. It uses locale for this, so you may get incorrect results if your locale is not set up correctly.

AVAILABILITY

Top

It should be available for download from http://russell.matbouli.org/code/lingua-pangram/ or from CPAN, in the directory authors/id/I/ID/IDORU.

AUTHOR

Top

Russell Matbouli <lingua-pangram-spam@russell.matbouli.org>

http://russell.matbouli.org/

CONTRIBUTORS

Top

Thanks to Philip Newton for a patch

TODO

Top

Perhaps create minpangram which tests whether the string contains exactly one of each letter.

LICENSE

Top

Distributed under GPL v2. See COPYING included with this distibution.

SEE ALSO

Top

perl(1), locale.


Lingua-Pangram documentation  | view source Contained in the Lingua-Pangram distribution.