Indexer

[INDEXER.BBX 2KB]

This neural network determines whether a four-bit pattern is located in an input string. To test this network, set up the input string and the pattern in any way you wish. When you run the net, it will tell you if the pattern was located somewhere in the input string.
[Image of network]
The grid of eight neurons below the output perform xor functions. When execution is started, the output neuron must be off, and at least one of the xor neurons must be on. The name indexer comes from C and MOO functions that search one string for occurrences of another; Basic uses an equivalent function named instr.

Naturally the input string and the pattern may be increased (or decreased) to any length. This network could be enhanced to record how many instances of the pattern were found, or where the first or last instance was located within the input string.

-------------------------------------
Last modified: 21 September 1998