Memory and locality in natural language