Skip to main content
Use an element of type Character String to detect the Country field. The element sits on the same horizontal level as the field name, and FlexiLayout Studio uses it only when the name is detected.
1

Create the Character String element

In the Footer element, create an element of type Character String and name it Country.
2

Set the character string properties

Click the Character String tab and set these properties:
  • Select all Latin characters as the alphabet.
  • Set Percentage of non-alphabet characters to 20.
  • In the Character count field, specify this fuzzy interval: [-1, 2, 25, 2147483647] (2 to 25 characters). Any hypothesis outside this range is penalized.
Leave the default values for the element’s other properties.
3

Set the position constraints

Click the Relations tab. The Country field appears only to the right of the kwOrigin name keywords, no farther than 500 dots from its right boundary, and always on the same level as those keywords, so set these search constraints:
  • Right of the kwOrigin element, Offset = 10
  • Left of the kwOrigin element, Offset = -500, Reference boundary = Right
  • Above the kwOrigin element, Offset = -10, Reference boundary = Bottom
  • Below the kwOrigin element, Offset = -10, Reference boundary = Top
When selecting offset values, analyze the geometrical properties (size and boundaries) of the neighboring objects detected during pre-recognition. Otherwise, select these values by trial and error.
4

Add the optional-name constraint

Click the Advanced tab. The Country field is optional on this document, but whenever it occurs it always appears next to its name. Set this additional search constraint in the Advanced pre-search relations field: look for the object only if the kwOrigin element was detected. In the FlexiLayout language:
5

Verify the match

Match the FlexiLayout with the test images and confirm that FlexiLayout Studio detects the element on every image where it occurs.
6

Set the block source element

To describe the location of the Country block, select Source element, click Browse button, and select the Country element as the source element.