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

NAME

Data::BitStream::Code::Levenstein - A Role implementing Levenstein codes

VERSION

version 0.08

DESCRIPTION

A role written for Data::BitStream that provides get and set methods for the Levenstein codes. The role applies to a stream object.

These are also known as Levenshtein or Левенште́йн codes. They are often used in situations where the Elias Omega, Even-Rodeh, or Fibonacci codes would be considered.

METHODS

Provided Object Methods

put_levenstein($value)
put_levenstein(@values)

Insert one or more values as Levenstein codes. Returns 1.

get_levenstein()
get_levenstein($count)

Decode one or more Levenstein codes from the stream. If count is omitted, one value will be read. If count is negative, values will be read until the end of the stream is reached. In scalar context it returns the last code read; in array context it returns an array of all codes read.

Required Methods

read
write
get_unary1
put_unary1

These methods are required for the role.

SEE ALSO

V.E. Levenstein, "On the Redundancy and Delay of Separable Codes for the Natural Numbers," in Problems of Cybernetics v. 20 (1968), pp 173-179.

AUTHORS

Dana Jacobsen <dana@acm.org>

COPYRIGHT

Copyright 2011 by Dana Jacobsen <dana@acm.org>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.