Text this: Grammatical categorisation based on form and function