Course:CPSC312-2019/ChomskySentenceGenerator

From UBC Wiki
An example of a Chomsky Sentence

Chomsky Sentence Generator

Authors:

Owen Tangjintanakarn, Joshua Mattson

What is the problem?

We created a sentence generator based on modelling the logical structure of language. A normal sentence can have the components "Syntax" which makes the sentence grammatically correct but non-sensical. It can have "Semantics" which makes the sentence carry meaning be and logical. Finally "Pragmatics" explain the purpose of the sentence.

This prolog program is able to generate four separate sentences. Option one allows the user to generate a sentence with syntax, semantics and pragmatics. An example of that is "You are reading text on a screen now". Option two removes pragmatics creating a sentence like "The green frog sleeps soundly". This uses proper grammar and is logical, however it carries no pragmatic meaning for us. Option three is a Chomsky Sentence. This sentence only has proper syntax. The famous example Chomsky himself created is "Colourless green ideas sleep furiously". Option four is simply a wild non-sensical, non-grammatical sentence that is also randomly generated.

What is the something extra?

We added user input to control which sentences are being generator. This way the structure is modifiable and can be used as an educational tool to show people this concept in linguistics more effectively.

What did we learn from doing this?

Our project relies on prolog's DCGs or "Definite Clause Grammar. We learned how to learn these effectively in order to generate sentences and grammar structures. Our overall understanding of prolog was improved when trying to implement the user input system.

Links to code etc:

Inspiration:

Chomsky Grammar

Chomsky Sentence

Code:

project