Vertical Wrap (Property): Difference between revisions

From Grooper Wiki
No edit summary
No edit summary
Line 70: Line 70:
|}
|}


{|cellpadding=10 cellspacing=5
|valign=top style="width:40%"|
'''''Vertical Wrap''''' is enabled by default when adding the ''Labeling Behavior'' to a '''Content Model'''.
'''''Vertical Wrap''''' is enabled by default when adding the ''Labeling Behavior'' to a '''Content Model'''.


Line 78: Line 80:
|-
|-
|valign=top|
|valign=top|
Next part waiting on guidance from dev.
|
IMAGE.png
|}


</tab>
</tab>
</tabs>
</tabs>

Revision as of 13:46, 31 March 2021

Vertical Wrap is a property of the Content Model Labeling Behavior and certain Extractor Types used to provide simplified extraction of stacked labels.

About

Stacked labels are simply multi-word labels whose words are aligned vertically on multiple lines. In other words, they are "stacked" on top of each other. You can contrast this with simple labels which appear on a single line of the document.

In the before times (before version 2021), stacked labels presented somewhat of a challenge. For simple labels, the approach is, well, simple. We use regular expression to match the label. Do you want to match the label "ZIP CODE"? Your regex pattern is simply ZIP CODE.

However, for stacked labels, it's a little trickier. Regular expression matches a regex pattern against the entire document as one big text string. By itself, it doesn't have the capability to match labels stacked on top of each other because it just matches against the text flow character by character.

Instead, we had to use a Data Type, collated as an Ordered Array, using the Vertical Layout mode, looking for each line of the stacked label as the array elements, and usually specifying some minimum distance between the words in the label to throw out false positive results.

You can see here an example of how this was done.

  1. This is the parent Data Type (also the object we have selected in the Node Tree).
  2. The two child extractors return the results of each line.
  3. The Data Type is configured to use the Ordered Array option for its Collation, enabling Vertical Layout mode.
  4. The Data Type returns the label, looking for the word "ZIP" stacked on top of "CODE".


Seems like a lot of work to find the label "ZIP CODE", right?

Starting in version 2021, there is a much easier way of doing this through the Vertical Wrap property.

Currently, the Vertical Wrap property is accessible at two points in Grooper.

  1. When using the List Match Extractor Type.
  2. When using the Content Model Labeling Behavior.

Vertical Wrap and List Match

At any point you can use the List Match Extractor Type you can enable vertical wrapping.

  1. Here, we've created and selected a Value Reader.
  2. We've set its Extractor Type to List Match.
  3. We have a single label in our Local Entries list of labels, ZIP CODE
  4. As you can see, it returns the simple label.
  5. However, it does not return the stacked label yet.

We can get both the simple and stacked label to match using the Vertical Wrap property. For the List Match Extractor Type, vertical wrapping is enabled using the Vertical Wrap property in the "Properties" tab.

  1. Navigate to the "Properties" tab.
  2. Change the Vertical Wrap property from Disabled to Enabled.
    • This property is found under the Options property heading.
  3. Now both the simple and stacked labels are matched and returned!

Labeling Behavior and Vertical Wrap

FYI Labeling Behavior is a Content Type Behavior that utilizes a document's labels for a variety of document processing purposes. For more information on the Labeling Behavior functionality, visit the Labeling Behavior article

Vertical Wrap is enabled by default when adding the Labeling Behavior to a Content Model.

  1. Here, we've added the Labeling Behavior to our Content Model using its Behaviors property.
  2. As you can see, the Vertical Wrap property is Enabled by default.

Next part waiting on guidance from dev.

IMAGE.png