Excerpt |
---|
Markup Producer stage will producer strings of TEXT_BLOCK or SENTENCE texts 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 Configuratio Parameters |
---|
| Generic Producer Configuratio Parameters |
---|
|
Configuration Parameters
- normalizeTags (String array, required) - 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 of them is in the preferFlags, it will take precedence over other flags to use the value of the token from that variation, i.e. LOWERED flag over original text version.
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | Example 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 |
---|
language | text |
---|
theme | FadeToGrey |
---|
|
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 |
---|
language | js |
---|
theme | FadeToGrey |
---|
|
{#} {measurement} of <START:ingredient> Water <END>
use {#} {measurement} of <START:ingredient> FLOUR <END> |