Difference between revisions of "Filter"
From DocDataFlow
Line 9: | Line 9: | ||
Consider the following data flow which originated somewhere up-flow. This is the input to the example filter: | Consider the following data flow which originated somewhere up-flow. This is the input to the example filter: | ||
+ | <pre> | ||
Word: This | Word: This | ||
Word: is | Word: is | ||
Line 20: | Line 21: | ||
Para: This is another paragraph | Para: This is another paragraph | ||
TextFrame: pos (10, 20), width 20, height 80 | TextFrame: pos (10, 20), width 20, height 80 | ||
+ | </pre> | ||
If a filter is set up to drop any words starting with a lower case letter, the output of the filter would become: | If a filter is set up to drop any words starting with a lower case letter, the output of the filter would become: | ||
+ | <pre> | ||
Word: This | Word: This | ||
Para: This is a paragraph | Para: This is a paragraph | ||
Line 28: | Line 31: | ||
Para: This is another paragraph | Para: This is another paragraph | ||
TextFrame: pos (10, 20), width 20, height 80 | TextFrame: pos (10, 20), width 20, height 80 | ||
+ | </pre> |
Revision as of 19:12, 29 December 2013
A filter is an atomic adapter which can selectively strip granules from the data flow.
Inside the filter, there is some programming logic which checks every input granule, and returns a pass/fail answer.
Any granules that fail the test are dropped from the data flow.
An example: a filter could be set up to drop any word granules that contain a word that starts with a lower case letter.
Consider the following data flow which originated somewhere up-flow. This is the input to the example filter:
Word: This Word: is Word: a Word: paragraph Para: This is a paragraph Word: This Word: is Word: another Word: paragraph Para: This is another paragraph TextFrame: pos (10, 20), width 20, height 80
If a filter is set up to drop any words starting with a lower case letter, the output of the filter would become:
Word: This Para: This is a paragraph Word: This Para: This is another paragraph TextFrame: pos (10, 20), width 20, height 80