This repo was first created as a solution to the problem proposed here: 'digital display'.
It takes a pattern in the form of a 3x3 matrix and represents it as a number from zero to nine. It can learn from different representations of that given data and adapt to respond accordingly.
Based on the following hash function, it's possible to extract a unique identifier for each 3x3 array group that represents a single digit on the display:
acumulator += (((y ^ d) + (xRef ^ d)) / 3) + (d * y);
Where d is the result from the call to GetHashCode - using the char on each of the 3x3 position in the training set matrix.
_ _ _ _ _ _ _ _
| | | _| _||_||_ |_ ||_||_|
|_| ||_ _| | _||_| ||_| _|
_ _ _ _ _ _ _ _
[ ] | _] _]|_|[_ [_ |[_][_]
[_] |[_ _] | _][_] |[_] _]
_ _ _ _ _ _ _ _
< > | _> _><_|<_ <_ |<_><_>
[_] |[_ _] | _][_] |[_] _]
The compilation output is the file DigitalDisplay.exe that can be used in two different ways:
The program will treat the input parameter as the path to a text file that shall be used to calculate the identification hash for each of the ten digits we are concerned. As a result the program will update the index file that comes with the solution (map.DigitalDisplay) and this will be the active pattern for future recognition.
Collisions are identified in the output as '/!\\invalid format/!\'
and keep the index file from being updated.
DigitalDisplay.exe "t>C:\\MyFile.txt"
Based on the active index file the program will try to identify the digits inside the provided feature file.
Parser errors outputs as: '/!\\invalid format/!\'
DigitalDisplay.exe "i>C:\\Myfile.txt"