Jacob Heil, Digital Scholarship Librarian, Dir. of CoRE

jheil@wooster.edu

tracery

An introduction

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Overview

VocaB

Code

examples

Introduction to Tracery

Overview

Introduction to Tracery

Tracery is a computer language for random text generation

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Written in JSON (javascript object notation) 

  • semi-structured data with "attribute" : "value" pairs.
  • flexible in terms of  lineation
  • incredibly inflexible in terms of syntax
  • Uses a replacement grammar, in which it identifies a "rule" and selects text associated with that rule as a replacement

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

VocaB

Introduction to Tracery

Grammar

{
  "origin": "Hello, world!"
}

Origin

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

VocaB

Introduction to Tracery

{
  "origin": "Hello, #planet#!",
  "planet": "earth"
}

Expansion

Rule

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Code

Introduction to Tracery

{
  "origin": "Hello, #planet#!",
  "planet": "earth"
}
{
    "origin": "Hello, #planet#!",
    "planet": ["earth", "mars", "pluto"]
}

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Introduction to Tracery

{
    "origin": "Hello, #planet#!",
    "planet": ["earth", "mars", "pluto"]
}
{
  "origin": "#greeting#, #planet#!",
  "planet": ["earth", "mars", "pluto"],
  "greeting": ["hello", "yo", "hola", "sup"]
}

examples

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Introduction to Tracery

{
  "origin": "#greeting#, #planet#!",
  "planet": ["earth", "mars", "pluto"],
  "greeting": ["hello", "yo", "hola", "sup"]
}
{
  "origin": "#greeting.capitalize#, #planet.capitalize#!",
  "planet": ["earth", "mars", "pluto"],
  "greeting": ["hello", "yo", "hola", "sup"]
}

examples

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Introduction to Tracery

{
  "origin": "#greeting.capitalize#, #planet.capitalize#, I am #opt#!",
  "planet": ["earth", "mars", "pluto"],
  "greeting": ["hello", "yo", "hola", "sup"],
  "opt": ["#flower.a#", "#flower.s#"],
  "flower": ["rose", "tulip", "carnation", "aster", "iris"]
}
 

examples

Jacob Heil, Digital Scholarship Librarian, Dir. of CoRE

jheil@wooster.edu

CHEAP BOTS DONE QUICK

WORKSHOP

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Overview

Code

CHEAP BOTS DONE QUICK

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Code

CHEAP BOTS DONE QUICK

{
"origin" : "A slave owner just sold a human being who was a mother."
}

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Code

CHEAP BOTS DONE QUICK

{
"origin" : "#offender.a.capitalize# just #act# #person.a# who was #relation.a#.\n\n
(We are learning about code via Bots and Tracery, and this is an homage to @every3minutes)",
    "offender" :  ["American", "white American", "white slaver", "white person", "slaver"],
    "act" :  ["sold", "bought", "purchased", "traded"],
    "person" : ["person", "enslaved person", "black person", "human being"],
    "relation" : ["mother", "father", "sister", "brother", "grandmother", "grandfather"]
}

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Code

CHEAP BOTS DONE QUICK

{
"origin": ["so much depends\nupon\n\n#fruits.a#\n#flowers#\n\nglazed with\n#abridged body fluids#\n\nbeside the #descriptions#\n#clothes.s#.\n\nhacked by NAME\n"],

   "fruits": ["apple", "apricot", "avocado"],
   "flowers": ["anemone","amaryllis","water lily","zinnia"],
   "abridged body fluids": ["amniotic fluid", "bile", "blood","sweat","tears"],
   "descriptions": ["able", "abnormal", "self-assured", "unwilling", "vulnerable", "zealous"],
   "clothes": ["ball gown", "belt", "cufflinks", "cummerbund", "dinner jacket"]
}

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Overview

Code

CHEAP BOTS DONE QUICK

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Overview

Code

CHEAP BOTS DONE QUICK

Jacob Heil, Digital Scholarship Librarian, Dir. of CoRE

jheil@wooster.edu

Python + Twitter Bots

WORKSHOP

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Access these slides on your device: https://slides.com/jacobheil/tracery

Follow along with lecture: http://tiny.cc/tracery

Overview

VocaB

Code

examples

Introduction to Python (kind of)

Jacob Heil, Digital Scholarship Librarian, Dir. of CoRE

jheil@wooster.edu

pythonanywhere.com

Account setup

Introduction to Tracery

By Jacob Heil

Introduction to Tracery

A very brief introduction to Tracery, a computer language for random text generation originally developed by Kate Compton. This brief introduction draws from Allison Parrish's excellent Tracery Tutorial (http://air.decontextualize.com/tracery/).

  • 423