Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

The Markup Producer

...

Stage will

...

produce strings of TEXT_BLOCK with normalized tags based on the graph's path with highest confidence.


Operates On:  Every lexical Item in the graph.

Include Page
Generic Configuration Parameters
Generic Configuration Parameters


Include Page
Generic Producer Configuration Parameters
Generic Producer Configuration Parameters

Configuration Parameters

  • normalizeTags (String array) - List of tag names to normalize on the output.
  • replaceTags (String array, optional) - Defaults to empty. If non empty, list of tag names to apply the replace pattern to.
  • replacePattern (String, optional) - Required when replaceTags is set. The pattern expects a %tag and/or %value

...

  • . Pattern will replace the appearance of tags from replaceTags with the pattern defined.
  • separator (String, optional) - Default to single whitespace. Used to separate tokens.
  • preferFlags (String array, optional) - Defaults to empty. If non empty, when a token has multiple flags and one

...

  • is in the preferFlags, it will take precedence over other flags (to use the value of the token from that variation

...

  • ). That is, LOWERED flag over original text version.
  • ignoreTags (string array, optional) - Ignore matches with tags specified in the ignoreTags list.
  • anyWithTags (string array, optional) - Include matches with tags specified in the anyWithTags list.


Code Block
languagejs
themeEclipse
titleExample Configuration
{
  "type": "MarkupProducerStage",
  "name": "MarkupProducer",
  "boundaryFlags": [
    "TEXT_BLOCK_SPLIT", "SENTENCE_SPLIT"
  ],
  "normalizeTags": ["#", "measurement"],
  "replaceTags": ["ingredient"],
  "replacePattern": "<START:%tag> %value <END>",
  "separator": " "
}

Example Output

If you have a text block like the following:

Code Block
languagetext
themeFadeToGrey
V-----------------------------------[300 ml of Water. Use XX g of FLOUR]------------------------------------V 
^----------------[300 ml of Water]----------------V-------------------[Use XX g of FLOUR]-------------------^ 
^-[300]-V------[ml]-------V-[of]-V----[Water]-----^-[Use]-V-[XX]--V-------[g]-------V-[of]-V----[FLOUR]-----^ 
^-[{#}]-^-[{measurement}]-^      ^----[water]-----^-[use]-^-[xx]--^-[{measurement}]-^      ^----[flour]-----^ 
                                                          ^-[{#}]-^                        ^-[{ingredient}]-^ 
                                                                                           ^-[{ingredient}]-^ 
                                 ^-[{ingredient}]-^ 
                                 ^-[{ingredient}]-^ 

the

...

stage

...

will

...

produce

...

the

...

following

...

output:

Code Block
themeFadeToGrey
{#} {measurement} of <START:ingredient> Water <END>
use {#} {measurement} of <START:ingredient> FLOUR <END>