Processor

From DocDataFlow
Revision as of 19:50, 29 December 2013 by Kris (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A processor is an atomic adapter which can convert granules into other granules.

Inside the processor, there is some programming logic which will select particular types of input granule, and returns a different granule instead.

The original granules that is converted is normally dropped from the data flow; they are replaced by the newly created 'processed' granules.

A processor will never modify a granule; it's not even able to.

In the Crawler system, once created, a granule is never modified.

A granule is a 'constant' data entity. Instead, a processor can only substitute some of the input granules by newly created granules.

An example: a processor could be set up to substitute any word granules with all uppercase word granules.

Consider the following data flow which originated somewhere up-flow. This is the input to the example processor:

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

The output could look like this:

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