Text this: The mathematics of syntactic structure