Area Constraints

The goal of Area Constraints is to produce a specific area that will 'box in' the final target Search, for which you will usually set a generic Regular Expression such as .+ to capture anything inside the area.

Each constraint forms its own area with:

  • A constraining edge
  • Whether the area begins at the start or end of the keyword (Inclusive property)
  • Max Width and Max Height expanding out from that edge

Area Constraints can work in combination or in isolation and are defined in the form of a connector between the keyword Search, and the target Search.

For example, you may have one search that identifies the top edge of the final search area, and another that identifies the left edge, etc.

You are not required to define all edges, because each constraint can form a search box in its own right, using the Max Width and Max Height properties.

When Aluma runs, it associates and groups the results that are logically close together, to form the smallest (or most constrained) bounding box it can around each target search.

A way of limiting a Search with a single constraint:

  • 'Description' constraint set to constrain the Left edge of the final area
  • Inclusive parameter set to False ensures the edge is drawn at the end of keyword text
  • Max Width of 4” and Max Height of 1” defines the rest of the area

Example of a single Area Constraint limiting a Search (click to enlarge)

Inclusive property

The Inclusive property of an Area Constraint sets whether the bounding edge starts at the beginning (or top) of the keyword, or the end (or bottom).

For example, with Inclusive set to False for this Left edge constraint, the left edge of the box is drawn to the right of the word 'Description'. If you wanted the edge to be drawn at the left extremity of the keyword, therefore including it, you would set the property to True.

Using multiple constraints

A better solution may be to use two constraints, and in this case the Max Height could be left undefined for the 'Description' constraint, such that it goes on for infinity (or until the edge of the page) in both directions. The final smallest constrained area is now bound by the 'Product Details' constraint at the top, and the 4" maximum width of the 'Description' constraint, creating a sensible box which should capture all the text.


Example of two Area Constraints working together (click to enlarge)

The importance of knowing how multiple constraints interact, and the potential pitfalls of configuring them incorrectly, are highlighted in this example:

  • 'Description' Left constraint still has 1" Max Height defined (configuration mistake)
  • 'Product Details' Top constraint now redundant because smallest area preferred
  • Some of the target text could be missed if it starts earlier than expected or gets too long
  • In summary – use Max Width / Max Height carefully!

Example of an incorrectly configured pair of Area Constraints (click to enlarge)