Created
May 27, 2015 03:15
-
-
Save skatenerd/d77081d12d4b81b5746c to your computer and use it in GitHub Desktop.
wat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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