Skip to content

Making-with-Code/lab_types

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Types Lab

In this lab, we learn about types by writing functions whose inputs and outputs are English parts of speech. Once you finish, you will be able to generate syntactically-correct phrases which you can use to write auto-poetry like:

Roses are red
Violets are blue
Evenings are poisonous
And so are you.

I used to have a formative scratch
Until i swapped it for an icy latch.

There once was a person named pete
Who owned an optical cleat.
He widely canvassed it,
And then he canvased it,
Until it turned into a beat.

Installation

After cloning this repository, install its dependencies:

$ pip install requirements.txt

Usage

  • vocabulary.py has a bunch of functions for picking random words. grammatical_types.pydefines types likeNoun, Adjective, and TransitiveVerb`.
  • grammar.py has a bunch of functions for combining and transforming grammatical types. These are unfinished; it's your job to write them.
  • poetry.py has functions for writing beautiful auto-poems. Once grammar.py is complete, try running python poetry.py.

About

Using types to implement English syntax

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%