Hierarchical Temporal Memory (Cortical Learning Algorithms) implementation in Ruby