Natural language grammatical inference: A comparison of recurrent neural networks and machine learning methods