ShannonFinger:
Filter:
Classes (extension) | Collections > Unordered | Libraries > MathLib > Markov & Fuzzy

ShannonFinger : ShannonMarkovSet : Object
ExtensionExtension

shannon implementation of a markov set

Description

The basic shannon implementation of a markov set is to simply leave the data as it is and to iterate over it by doing random jumps and looking for the next matching item. The item that follows that one is the next item of the chain. As this requires searching the data, which can be of very irregular efficiency, this current implementation uses an identity dictionary to find the indices of items in constant time. Higher order is slightly more costly, but still this is a major speed increase.

This implementation allows to vary the order at each step and it is very fast in reading. In difference to MarkovSet and MarkovSetN it can only read data as a chain, not as single nodes. Also it does not compress data, as the standard implementation does.

Part of MathLib, a diverse library of mathematical functions.

Class Methods

Inherited class methods

Instance Methods

.next(object, order: 1)

From superclass: ShannonMarkovSet

Return the next node for the input obj, using nth order (default = 1).

.put(index, obj)

Put object in the data at index i.

.wrapPut(i, item)

From superclass: ShannonMarkovSet

wrapPut object in the data at index i.

.parse(pattern, length)

From superclass: ShannonMarkovSet

Read length items of stream.

.asStream(order: 1, repeats: inf)

From superclass: ShannonMarkovSet

Return a stream that reads from this set. order can be any object that returns a stream on .asStream, returning integers.

Inherited instance methods

Undocumented instance methods

.chooseIndex

.clear(size)

.indexOf(obj)

.initDict

.lookUp

.nextIndex(prevIndex, order: 1)

Examples

setting the data

using the set with the message -next

generating a stream

Authors

Julian Rohrhuber, et al, 2003.