> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Static Text

> Tune Static Text element search in the FlexiLayout language with error limits, case sensitivity, database or file text sources, and word penalties.

The **Static Text** element supports the following parameters in the FlexiLayout language.

## Static Text parameters

| Parameter                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void MinQuality( Real )`                                                                           | Sets the minimum quality of the hypothesis.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Void MaxErrors( Int )`                                                                             | Sets the maximum number of errors in the hypothesis. See [**Static Text**](/flexi-capture/fls/template/static-text), **Max number of errors**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `Void MaxErrorsPart( Real )`                                                                        | Sets the maximum percentage of errors in the hypothesis. See [**Static Text**](/flexi-capture/fls/template/static-text), **Max error percentage**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `Void MaxErrors( Int number, Real part )`                                                           | Sets both the maximum number of errors (`number`) and the maximum percentage of errors (`part`) in the hypothesis. **Note.** FlexiLayout Studio uses the stricter of the two conditions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `Void MaxGapInLine( Distance )`                                                                     | Sets the maximum distance between neighboring characters. When generating a hypothesis, FlexiLayout Studio adds characters to the hypothesis as long as the distance between two neighboring characters does not exceed `MaxGapInLine`. See also [**Character String**](/flexi-capture/fls/template/character-chain), **Max space length**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Void MaxRelativeGapInLine( Real )`                                                                 | The maximum distance between neighboring characters expressed as a percentage of the line height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `Void AllowChoppedWords( Logic )`                                                                   | The flag specifies whether text objects which do not fit entirely within the left and right boundaries should be included in the hypothesis. The default value is `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `Void MaxXOutsidePart( Real )`                                                                      | Specifies the part of the character that may extend beyond the search area horizontally. The part of the character is specified by a number from `0` to `1`. Characters that have the specified or smaller part outside the search area are included in the hypothesis.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `Void MaxYOutsidePart( Real )`                                                                      | Specifies the part of the character that may extend beyond the search area vertically. The part of the character is specified by a number from `0` to `1`. Characters that have the specified or smaller part outside the search area are included in the hypothesis.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `Void CaseSensitive( Logic Value=true )`                                                            | Distinguishes between lowercase and uppercase letters if set to `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `Void IgnoreAccents( Logic value = true )`                                                          | Specifies whether diacritics are ignored when searching for text. If the value is set to `true`, diacritics will be ignored (for example, the words "café" and "cafe" will be treated as identical).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `Void SearchTextFromDB( String connectionString, String selectString, Int maxRecordsCount = 1000 )` | Specifies the set of strings to be searched on an image with the help of a database. For more information, see [Databases and text files in the FlexiLayout language](/flexi-capture/fls/language/bd-textfiles). The `connectionString` argument sets the connection string for connecting to the database. The `selectString` argument sets an SQL query, which starts with the `SELECT` command. The resulting set obtained by this query, which must contain only one field, represents phrase variants. In its simplest form, a query gets the required field from a specified database table. If a query returns more than one field, the data from the first field are used for the search. To speed up the search, only the first `maxRecordsCount` variants are used (the default setting is 1000). |
| `Void SearchTextFromFile( String fileName, Int maxRecordsCount = 1000 )`                            | Specifies the set of strings to be searched on an image with the help of a `fileName` text file. For more information, see [Databases and text files in the FlexiLayout language](/flexi-capture/fls/language/bd-textfiles). To speed up the search, only the first `maxRecordsCount` variants are used (the default setting is 1000).                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `AllowIntersectPercent( Real )`                                                                     | Specifies the maximum allowed percentage of vertical overlap for two lines of text (the default setting is 15). You may want to use this parameter for texts with tight line spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

Example for `MaxErrors( Int number, Real part )`:

The following code tells FlexiLayout Studio that the absolute number of errors may not exceed `3`, and the percentage of errors may not exceed `20%`.

```text theme={null}
MaxErrors (3, 0.2);
```

Example for `MaxGapInLine`:

The following code tells FlexiLayout Studio that the maximum distance between neighboring characters may not exceed 5 mm. Otherwise, a null hypothesis is generated.

```text theme={null}
MaxGapInLine (5mm);
```

Example for `AllowChoppedWords`:

The following code tells FlexiLayout Studio to look for the element only among the text objects that fit entirely within the search area.

```text theme={null}
AllowChoppedWords (False);
```

Example for `SearchTextFromDB`:

```text theme={null}
SearchTextFromDB: "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\\FCS\\DBKeywords.mdb", "SELECT Words FROM WordsTable", 500;
```

Example for `SearchTextFromFile`:

```text theme={null}
SearchTextFromFile: "Keywords.txt", 500;
```

## Single-word text methods

These methods are available only if the text to find consists of one word.

| Parameter                    | Description   |
| ---------------------------- | ------------- |
| `Void SearchText ( String )` | Text to find. |

## Multi-word text methods

These methods are available if the text to find consists of several words.

| Parameter                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void NextLinePenalty( Real )`                | See [**Static Text**](/flexi-capture/fls/template/static-text), **Break line penalty**.                                                                                                                                                                                                                                                                                                                                                        |
| `Void OmissionPenalty( Real )`                | See [**Static Text**](/flexi-capture/fls/template/static-text), **Missed words penalty**.                                                                                                                                                                                                                                                                                                                                                      |
| `Void WholeWordMode ( Logic )`                | The flag specifies whether only whole text objects must be considered as valid hypotheses. When set to `true`, hypotheses consisting of parts of words are ignored. The default setting is `false`. **Note.** This method is different from `AllowChoppedWords` in that `AllowChoppedWords` affects only hypotheses generated from words on the boundary of the search area, whereas `WholeWordMode` affects the generation of all hypotheses. |
| `Void AllowEmbeddedHypotheses( Logic )`       | Specifies whether embedded hypotheses are allowed. When set to `False`, FlexiLayout Studio formulates the longest hypothesis.                                                                                                                                                                                                                                                                                                                  |
| `Void MaxLineBreakDistance( Distance )`       | The distance between the word in the next line and the previous line.                                                                                                                                                                                                                                                                                                                                                                          |
| `SuggestOnlySimilarChars( Logic value )`      | When set to `true`, only characters (hieroglyphs) with similar tracing are allowed as replacement characters in character insertion/deletion/replacement operations.                                                                                                                                                                                                                                                                           |
| `Void AllowedTextRotations ( TextRotations )` | Specifies a set of orientations of the recognized text in which an element search is allowed.                                                                                                                                                                                                                                                                                                                                                  |

Example for `AllowEmbeddedHypotheses`:

The following code tells FlexiLayout Studio that it must formulate the longest hypothesis.

```text theme={null}
AllowEmbeddedHypotheses (False);
```
