Skip to content

Instantly share code, notes, and snippets.

@kornypoet
Created September 21, 2012 15:53
Show Gist options
  • Save kornypoet/3762290 to your computer and use it in GitHub Desktop.
Save kornypoet/3762290 to your computer and use it in GitHub Desktop.
Sample Wukong flow
Wukong.processor(:ogify) do
def process(record)
emit(record.gsub(/(a\w|e\w|i\w|o\w|u\w)/, 'og'))
end
end
Wukong.processor(:poify) do
def process(record)
emit(record.gsub(/(q|x|z|k|j)/, 'po'))
end
end
Wukong.processor(:femify) do
def process(record)
emit(record.gsub(/(pg|gp|gg|gb|bg|pb|bp|gc|cg)/, 'fem'))
end
end
Wukong.dataflow(:translator) do
input(:default, stdin)
output(:dump, stdout)
input(:default) > ogify > poify > femify > output(:dump)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment