Skip to content

Instantly share code, notes, and snippets.

@gamesbyangelina
gamesbyangelina / heroname.py
Created June 14, 2013 04:27
Quick Python script that uses Tony Veale's Metaphor Magnet (http://ngrams.ucd.ie/metaphor-magnet-acl) to generate poetic descriptions of heroes. Nothing fancy, just playing around.
from xml.etree import ElementTree as ET
import urllib
import os
import itertools, random
plus = "%2B"
neg = "-"
def getText(nodelist):
rc = []