Math::String::Charset

Math::String::Charset is a simple charset for Math::String objects.
Download

Math::String::Charset Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Tels
  • Publisher web site:
  • http://search.cpan.org/~tels/

Math::String::Charset Tags


Math::String::Charset Description

Math::String::Charset is a simple charset for Math::String objects. Math::String::Charset is a simple charset for Math::String objects.SYNOPSIS use Math::String::Charset; $a = new Math::String::Charset; # default a-z $b = new Math::String::Charset ; # same $c = new Math::String::Charset { start => , sep => ' ' }; # with ' ' between chars print $b->length(); # a-z => 26 # construct a charset from bigram table, and an initial set (containing # valid start-characters) # Note: After an 'a', either an 'b', 'c' or 'a' can follow, in this order # After an 'd' only an 'a' can follow $bi = new Math::String::Charset ( { start => 'a'..'d', bi => { 'a' => , 'b' => , 'c' => , 'd' => , 'q' => , # 'q' will be automatically in end } end => , } ); print $bi->length(); # 'a','b' => 2 (cross of end and start) print scalar $bi->class(2); # count of combinations with 2 letters # will be 3+2+2+1 => 8 $d = new Math::String::Charset ( { start => , minlen => 2, maxlen => 4, } ); print $d->first(0),"n"; # undef, too short print $d->first(1),"n"; # undef, to short print $d->first(2),"n"; # 'aa' $d = new Math::String::Charset ( { start => } ); print $d->first(0),"n"; # '' print $d->first(1),"n"; # 'a' print $d->last(1),"n"; # 'z' print $d->first(2),"n"; # 'aa'This module lets you create an charset object, which is used to contruct Math::String objects. This object knows how to handle simple charsets as well as complex onex consisting of bi-grams (later tri and more).In case of more complex charsets, a reference to a Math::String::Charset::Nested or Math::String::Charset::grouped will be returned.The default charset is the set containing "abcdefghijklmnopqrstuvwxyz" (thus producing always lower case output).Requirements:· perl5.005· Exporter· Math::BigInt Requirements: · perl5.005 · Exporter · Math::BigInt


Math::String::Charset Related Software