Sample 2. Step 24: Creating a CookingDescription block
To create the CookingInstructions block:
- Click the FlexiLayout tab in the program main window.
- Select the Blocks object in the FlexiLayout tree.
- Select Blocks → Add Block → Text in the FlexiLayout menu or in the shortcut menu.
- In the Properties dialog box, specify the name of the block in the Name field: CookingInstructions.
- To describe the location of the block, select Expression.
- You must describe the location of the block so that it includes only the cooking instructions and the number of servings. The block must not include unwanted text (i.e. any text that may precede the word "Serves"). Describe the block as a collection of rectangles around the following elements: CookingDescription, Serves and Servings. This method allows you to specify non-rectangular regions.
In the FlexiLayout language this must be written as follows:
RectArray outputRectArray;
//initializing the variable with the help of an empty constructor
outputRectArray = RectArray();
//adding the rectangles of the hypotheses of three elements
outputRectArray.Add ( SearchElements.Cooking.Description.CookingInstructions.Rect );
outputRectArray.Add( SearchElements.Cooking.Description.Serves.Rect );
outputRectArray.Add( SearchElements.Cooking.Description.Servings.Rect );
OutputRegion = Region( outputRectArray );
4/12/2024 6:16:02 PM