Skip to main content
If a regular expression is specified in the properties of an element, FlexiLayout Studio looks for any strings in the search area that meet the conditions in the regular expression. If no regular expression is specified, FlexiLayout Studio uses the user-defined alphabets.

How lines and fragments are identified

FlexiLayout Studio considers all the text objects that horizontally intersect the search area (vertically, the objects must fit within the search area in their entirety). The text objects are then grouped into lines. Lines are built left to right and stop when the maximum length of space (set in the Max space length property) is exceeded. In the resulting lines, FlexiLayout Studio identifies character strings, each of which contains characters from only one of the user-defined alphabets. In the same way, it divides lines into fragments.

Embedded hypotheses

Next, FlexiLayout Studio formulates a hypothesis for each of the fragments. Depending on whether the Allow embedded hypotheses option is selected, hypotheses are formulated in one of two ways. Suppose FlexiLayout Studio detected three fragments at a previous stage. If the Allow embedded hypotheses option is selected, hypotheses are formulated as follows:
For each hypothesis, FlexiLayout Studio checks that the percentage of characters of each alphabet does not exceed the value set in the Percentage of alphabet characters field. It also checks that the percentage of non-alphabet characters does not exceed the value set in the Percentage of non-alphabet characters field. If at least one check fails, no hypothesis is formulated. If the Allow embedded hypotheses option is not selected, the embedded hypotheses in the preceding list are discarded. Embedded hypotheses are those contained within another hypothesis in that list. If the checks succeed for all of the hypotheses, only one hypothesis remains: fragment 1 + fragment 2 + fragment 3. So, when the Allow embedded hypotheses option is not selected, FlexiLayout Studio formulates hypotheses of maximum length that meet all of the conditions. Even though embedded hypotheses are excluded, hypotheses may still intersect. The intersecting part may be a stand-alone character or word, or a string of characters that are part of other hypotheses but for which no separate hypotheses have been formulated. For example, FlexiLayout Studio may formulate two hypotheses (that is, two strings): one ending in a certain word or phrase and another starting with that word or phrase. Two intersecting hypotheses might look like this:

How hypothesis quality is calculated

Once all the possible hypotheses are generated, FlexiLayout Studio calculates the Pre-search quality for each. This value estimates how well a hypothesis meets the search constraints set in the Properties dialog box on the Character String tab, and on the Advanced tab in the Advanced pre-search relations field. At this stage, the quality depends on three checks:
  • Whether the length of the hypothesis in characters falls within the fuzzy interval specified in the Character count property
  • Whether the length of the total gap in the line falls within the fuzzy interval specified in TotalGapLength
  • Whether the number of words in the line falls within the fuzzy interval specified in the Word count property
The overall quality of a hypothesis is the product of all these qualities.

Character String hypothesis properties

A Character String hypothesis has the following properties: