This post is about phrase-structure grammars, which can be both entertaining and educational.
If you're a linguistics student, you will be interested in this. We’re going to learn how to define
a little set of rules for a made up language, and then generate possible sentences in that
language based on the rules. We can also use it to test if something is grammatical in our
You may already be familiar with phrase structure from linguistics class, or parsing in programming. Regardless, this introduction is accessible for everyone - including novices.
We will first learn the basics of these little rules, and then illustrate by generating random plot summaries for possible episodes of the TV show Midsomer Murders
(à la the Midsomer Murders Bot on twitter) and also Beatles lyrics.
Even Barnaby can see the templatic nature of the show. How many nas do we need to generate this song? Nearley parser We will be using the Nearley parser, a computer program that helps parse se…
I was looking back fondly over my past rejected job applications, when I came across a cover letter that I wrote to Grammarly in 2017, a grammar-checking app that came to prominence due to their aggressive YouTube advertising campaigns. They were advertising for a job for linguists, aimed in particular at people working on natural language processing. I used Grammarly for a few days, and had some fun devising tortuous variants of ungrammatical sentences to test what it could do. It does many things well, but it also makes bizarre mistakes that reveal that the app is not attempting to parse the sentences, or was doing so very superficially, and on which it is out-performed by existing parsers such as the Google Natural Language API or the Stanford Parser. I wrote these points up in a cover letter and sent it to them, which got me invited to an uninformative Skype interview and a polite rejection some time later. What follows is a brief summary of these points.