Difference between revisions of "Filter"

From DocDataFlow
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
A filter is an [[Atomic adapter|atomic adapter]] which can selectively strip granules from the data flow.
+
A filter is an [[Atomic adapter|atomic adapter]] which can selectively strip [[Granule|''granules'']] from the data flow.
  
Inside the filter, there is some programming logic which checks every input granule, and returns a pass/fail answer.
+
Inside the filter, there is some programming logic which checks every input [[Granule|''granule'']], and returns a pass/fail answer.
  
Any granules that fail the test are dropped from the data flow.
+
Any [[Granule|''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.
 
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:
 +
 +
<pre>
 +
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
 +
</pre>
 +
 +
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
 +
Para: This is a paragraph
 +
Word: This
 +
Para: This is another paragraph
 +
TextFrame: pos (10, 20), width 20, height 80
 +
</pre>

Latest revision as of 19:13, 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