Sample 2. Step 13: Describing the field which contains the name of the recipe
Describe the recipe name field as the object closest to the bottom boundary of the form’s heading, but exclude those regions which contain the elements Recipe and RecipeNumber (see Step 8).
- Create an element of type Character String and name it RecipeName. This element will correspond to the name of the recipe.
- Create a RecipeName block corresponding to the field which contains the name of the recipe.
To create the RecipeName element:
- Create an element of Create Character String and name it RecipeName.
- Click the Character String tab.
- Set the required alphabet. Judging by the test images, the alphabet includes all the letters of the English alphabet, digits and the characters "#", "-", "&", and ".". The order and number of characters are not known in advance.
- Set the Percentage of alphabet characters to 1.
- Clear the Allow embedded hypotheses box.
- Set the Percentage of non-alphabet characters to 0.2 (i.e. 20%).
- In the Character count field, specify the fuzzy range that estimates the total length of all the character strings. Do not change the default range of {–1, –1, INF, INF}. This means that there are no constraints on the length of the character string.
- Click the Relations tab.
Tell the program that the name of the recipe is located at least 100 dots lower than the bottom boundary of the form’s heading, i.e. there must be a gap at least 100 dots wide between the heading and the recipe name. If you look at the test images you will see that every line located below the heading meets this criterion. The search area must be narrowed. - Click the Advanced tab.
In the Advanced pre-search relations field, specify an additional search constraint:Look for the line closest to the top boundary of the document. In the FlexiLayout language this must be written as follows:
NearestY: 0*dot;
together with the search constraint on the Relations tab this narrows the search area to one line located closest to the document heading.
Note.The same constraint can also be specified via the program’s graphical user interface. Click the Relations tab, select Nearest, and in the To drop-down list select Page top edge.
Show me...
- Click the Search Constraints tab.
- As stated in Step 8, the regions of the elements Recipe and RecipeNumber must be excluded from the search area for RecipeName. Click the Add... button next to the Exclude regions of elements field and in the Select Element to Exclude dialog box, select the Recipe and RecipeNumber elements.
Show me...
Try matching the FlexiLayout with the test images and make sure that the program successfully finds the field which contains the name of the recipe on all the images.
Finally, create the RecipeName block. The RecipeName block is created similarly to the RecipeNumber block. The only exception is that you must specify the RecipeName element as the source element for the RecipeName block.
12.04.2024 18:16:02