Vertical Wrap (Property)

From Grooper Wiki
(Redirected from Vertical Wrap)

This article was migrated from an older version and has not been updated for the current version of Grooper.

This tag will be removed upon article review and update.

This article is about the current version of Grooper.

Note that some content may still need to be updated.

2025 2021

Vertical Wrap is a property of certain Extractor Types and a Content Type's Labeling Behavior used to provide simplified extraction of vertically wrapped text (typically stacked labels).


About

You may download and import the file below into your own Grooper environment (version 2021). This contains the Batch(es) with the example document(s) discussed in this article and the Content Model(s) configured according to its instructions.


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 collecting labels for Document Types utilizing a 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!

Furthermore, the Vertical Wrap property will match wrapped results of multiple variations.

Take for example the label "Purchase Order Number:" With Vertical Wrap enabled, this List Match extractor matches:

  1. The simple label on a single line.
  2. Both varieties of the stacked label on two lines.
  3. And the stacked label on three lines.

All of this done just by enabling the Vertical Wrap property, using its default configuration.

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 Label Sets 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.

  1. This allows for the simple collection of stacked labels, such as the label for this "PO Number" Data Field.
  2. The label is stacked on the document, "PO" on top of "Number"
  3. But label is matched successfully.
    • It is both highlighted on the document viewer and green in the label collection editor.

  1. Were the Vertical Wrap property to be disabled (by setting it from Enabled to Disabled), the label would no longer match.

  1. Now the label no longer matches. It is highlighted red in the label collection editor and is not highlighted on the document viewer.
    • The Vertical Wrap property is extremely useful when collecting stacked labels.
FYI

Note the Layout property is set to Simple.

Vertical Wrap was designed to work well with certain label layouts (notably, Simple and Ruled Layout options). Typically, the Simple Layout will work best when matching stacked labels. It is possible a different layout could have been used to force a match with Vertical Wrap disabled. However, that is not the intended use of the other layout options. For more information on label layouts, visit the Label Sets article.

Furthermore, Vertical Wrap should only be disabled in extremely rare circumstances when the vertical wrapping property produces false positive matches for labels, and the false positives cannot be resolved by adjusting the Vertical Wrap settings or other methods.