The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Acme::Mobile::Therbligs - count keystrokes to write mobile text messages

SYNOPSIS

  use Acme::Mobile::Therbligs;

  $thurbs = count_therbligs("See u l8r");

  # $thurbs == 23
  

DESCRIPTION

This module counts the number of therbligs used to write mobile text messages. A therblig is unit used to measure the number of actions (in this case keypresses or pauses) for people who like to optimize industrial processes.

So you can use this module to determine useless facts such as that it takes as many keypresses to write "later" or "great" as it does "l8r" and "gr8".

The current version is case insensitive and assumes (by default) a particular brand of Nokia phone. (I have no idea which model it is; it was cheap, and it works, which is all I care about.)

A description of methods is below.

new
  $obj = Acme::Mobile::Therbligs->new();

This is used for the object-oriented interface. It is only useful if you want to specify your own keypad or modify the rules:

  open $fh, 'mykeypad.yml';
  $obj = Acme::Mobile::Therbligs->new($fh, \%rules );

The rule file is in YAML format that specifies the characters for each key pressed (in the order that they occur for each key press).

The optional rules allow one to change the behavior of the counting function:

  $obj = Acme::Mobile::Therbligs->new($fh,
  {
    SAME_KEY         => 1,
    NO_SENTENCE_CAPS => 0,
  });
SAME_KEY

The number of therbligs to count as waiting when having to enter letters which require pressing the same key (as with the word "high"). Defaults to 1.

NO_SENTENCE_CAPS

By default the initial letter of the message and of each sentence is assumed to be capitalized (when counting in case-sensitive mode). This option disabled that.

count_therbligs
  $count = count_therbligs($message, $case_flag);

  $count = $obj->count_therbligs($message, $case_flag);

Returns the number of "therbligs" (keystrokes) used to generate the message. A therblig is either a keystroke, or the pause when one has to wait in order to enter multiple letters from the same key (such as with the word "high").

The default number of therbligs for waiting in the same key is 1. There is no way to change that value for this version.

When $case_flag is true, the number of therbligs includes keystrokes to toggle the shift key. It assumes that the first letter of the message or a sentence is capitalized. (If $case_flag is unspecified, it is assumed to be false.)

AUTHOR

Robert Rothenberg <rrwo at cpan.org>

current Maintainer: Rene Schickbauer <rene.schickbauer at gmail.com>

REPORTING BUGS

We don't know of any bugs, but that doesn't mean there aren't any. Please the CPAN bugtracker or mail Rene Schickbauer directly.

COPYRIGHT AND LICENSE

Copyright (C) 2004-2005 by Robert Rothenberg. All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.

Now maintained by Rene Schickbauer, so i guess everything after version 0.01 is (C) 2010 Rene Schickbauer

SEE ALSO

This module is similar to Device::KeyStroke::Mobile.