Text this: Cognitive foundations of grammar