Created
September 21, 2012 15:53
-
-
Save kornypoet/3762290 to your computer and use it in GitHub Desktop.
Sample Wukong flow
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
| 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