Text this: A hardware Markov chain algorithm realized in a single device for machine learning