Vertical Wrap (Property): Difference between revisions

From Grooper Wiki
No edit summary
Redirected page to Vertical Wrap - 2021
Tag: New redirect
Line 1: Line 1:
[[File:Vertical-wrap-stacked-v-simple.png|right]]
#REDIRECT [[Vertical Wrap - 2021]]
 
<blockquote style="font-size:14pt">
'''''Vertical Wrap''''' is a property of the '''Content Model''' ''[[Labeling Behavior]]'' and certain '''Extractor Types''' used to provide simplified extraction of vertically wrapped text (typically stacked labels).
</blockquote>
 
== 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 <code>ZIP CODE</code>.
<br clear = all>
 
{|cellpadding=10 cellspacing=5
|valign=top style="width:40%"|
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.
# This is the parent '''Data Type''' (also the object we have selected in the Node Tree).
# The two child extractors return the results of each line.
# The '''Data Type''' is configured to use the ''Ordered Array'' option for its '''''Collation''''', enabling '''''Vertical Layout''''' mode.
# 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.
|
[[File:Vertical-wrap-about-01.png]]
|}
 
Currently, the '''''Vertical Wrap''''' property is accessible at two points in '''Grooper'''.
# When using the ''List Match'' '''''Extractor Type'''''.
# When using the '''Content Model''' ''Labeling Behavior''.
 
<tabs style="margin:20px">
<tab name="Vertical Wrap and List Match" style="margin:20px">
=== Vertical Wrap and List Match ===
{|cellpadding=10 cellspacing=5
|valign=top style="width:40%"|
At any point you can use the ''List Match'' '''''Extractor Type''''' you can enable vertical wrapping.
 
# Here, we've created and selected a '''Value Reader'''.
# We've set its '''''Extractor Type''''' to ''List Match''.
# We have a single label in our '''''Local Entries''''' list of labels, <code>ZIP CODE</code>
# As you can see, it returns the simple label.
# However, it does not return the stacked label yet.
|
[[File:Vertical-wrap-about-01.png]]
|-
|valign=top|
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.
 
# Navigate to the "Properties" tab.
# Change the '''''Vertical Wrap''''' property from ''Disabled'' to ''Enabled''.
#* This property is found under the '''''Options''''' property heading.
# Now both the simple and stacked labels are matched and returned!
|
[[File:Vertical-wrap-about-02.png]]
|}
</tab>
<tab name="Labeling Behavior and Vertical Wrap" style="margin:20px">
=== Labeling Behavior and Vertical Wrap ===
 
{|cellpadding="10" cellspacing="5"
|-style="background-color:#36b0a7; color:white"
|style="font-size:14pt"|'''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
|}
 
{|cellpadding=10 cellspacing=5
|valign=top style="width:40%"|
'''''Vertical Wrap''''' is enabled by default when adding the ''Labeling Behavior'' to a '''Content Model'''.
 
# Here, we've added the ''Labeling Behavior'' to our '''Content Model''' using its '''''Behaviors''''' property.
# As you can see, the '''''Vertical Wrap''''' property is ''Enabled'' by default.
|
[[File:Vertical-wrap-about-03.png]]
|-
|valign=top|
Next part waiting on guidance from dev.
|
IMAGE.png
|}
 
</tab>
</tabs>
 
{|cellpadding=10 cellspacing=5
|valign=top style="width:40%"|
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:
 
# The simple label on a single line.
# Both varieties of the stacked label on two lines.
# And the stacked label on three lines.
 
All of this done ''just'' by enabling the '''''Vertical Wrap''''' property, using its default configuration.
|
[[File:Vertical-wrap-about-04.png]]
|}
 
<!----
 
=== Additional Configuration Info ===
 
Flesh out this section as needed if peeps can't figure out sub-properties on they own.

Revision as of 15:14, 31 March 2021