Skip to content

Instantly share code, notes, and snippets.

@skatenerd
Created May 27, 2015 03:15
Show Gist options
  • Save skatenerd/d77081d12d4b81b5746c to your computer and use it in GitHub Desktop.
Save skatenerd/d77081d12d4b81b5746c to your computer and use it in GitHub Desktop.
wat
example_transformations = [
["colin, why dont you get it", "mark, why dont you get it"],
["I eat lots of bananas", "I eat lots of apples"],
["colin eats lots of bananas", "mark eats lots of apples"],
["milk tea is the best", "coffee is the best"],
["milk and tea are both great", "milk and tea are both great"]
["foo(1, 2)", "foo(1, 2, user=colin)"],
["foo(9)", "foo(9)"],
]
def sketch_transformer(pairs):
return lambda x: x
smartypants = sketch_transformer(pairs)
assertEqual(smartypants("colin likes to mash up bananas and put them in his milk tea"), "mark likes to mash up apples and put them in his coffee")
assertEqual(smartypants("foo(3, 4)"), "foo(3, 4, user=colin)")
assertEqual(smartypants("foo(100)"), "foo(100)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment