Text this: A generalization of the Hopfield single-layer recurrent neural network