> ## 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

> Configure Static Text element properties in FlexiLayout — quality, error tolerance, gap and overlap limits, case/diacritic handling, and searching text from files and data catalogs.

<table width="100%">
  <tbody>
    <tr><td><p><strong>Parameter</strong></p></td><td><p><strong>Description</strong></p></td></tr>
    <tr><td><p>Void MinQuality( Real )</p></td><td><p>Sets the minimum quality of the hypothesis.</p></td></tr>
    <tr><td><p>Void MaxErrors( Int )</p></td><td><p>Sets the maximum number of errors in the hypothesis.</p></td></tr>
    <tr><td><p>Void MaxErrorsPart( Real )</p></td><td><p>Sets the maximum percentage of errors in the hypothesis.</p></td></tr>
    <tr><td><p>Void MaxErrors( Int number, Real part )</p></td><td><p>Sets the maximum number of errors in the hypothesis: <em>number</em> – absolute number, <em>part</em> – percentage.</p><details><summary>E.g.</summary><p>The code below specifies that the absolute number of errors may not exceed 3, and the percentage of errors may not exceed 20%.</p><pre><code>MaxErrors(3, 0.2);</code></pre><p><strong>Note.</strong> Out of the two conditions the activity will use the strictest.</p></details></td></tr>
    <tr><td><p>Void MaxGapInLine( Distance )</p></td><td><p>Sets the maximum distance between neighboring characters.</p><p>When generating a hypothesis, the activity will add characters to the hypothesis until the distance between two neighboring characters does not exceed MaxGapInLine.</p><details><summary>E.g.</summary><p>The code below tells the activity that the maximum distance between neighboring characters may not exceed 5 mm, otherwise a null hypothesis is generated.</p><pre><code>MaxGapInLine(5mm);</code></pre></details></td></tr>
    <tr><td><p>Void MaxRelativeGapInLine( Real )</p></td><td><p>Sets the maximum distance between neighboring characters expressed as a percentage of the line height.</p></td></tr>
    <tr><td><p>Void AllowChoppedWords( Logic )</p></td><td><p>The flag specifies whether text objects which do not fit entirely within the left and right boundaries should be included into the hypothesis. The default value is <strong>True</strong>.</p><details><summary>E.g.</summary><p>The code below tells the activity to look for the element only among the text objects which fit entirely within the search area.</p><pre><code>AllowChoppedWords(False);</code></pre></details></td></tr>
    <tr><td><p>Void MaxXOutsidePart( Real )</p></td><td><p>Specifies the part of the text object that may lie outside the search area in the horizontal dimension. The part of the text object is specified by a number from 0 to 1. A text object is included in the hypothesis if the part of the text object outside the search area is not bigger than specified by this parameter.</p></td></tr>
    <tr><td><p>Void MaxYOutsidePart( Real )</p></td><td><p>Specifies the part of the text object that may lie outside the search area in the vertical dimension. The part of the text object is specified by a number from 0 to 1. A text object is included in the hypothesis if the part of the text object outside the search area is not bigger than specified by this parameter.</p></td></tr>
    <tr><td><p>Void CaseSensitive( Logic Value=true )</p></td><td><p>Distinguishes between lowercase and uppercase letters if set to <strong>True</strong>.</p></td></tr>
    <tr><td><p>Void IgnoreAccents( Logic value = true )</p></td><td><p>Ignores/does not ignore diacritics when searching for text. If the value is set to <strong>True</strong>, diacritics will be ignored (for example, the words "café" and "cafe" will be treated as identical).</p></td></tr>
    <tr><td><p><a id="SearchFromFile" />Void SearchTextFromFile( String fileName, Int maxRecordsCount = 1000 )</p></td><td><p>Specifies the set of strings to be searched on an image with the help of a <em>fileName</em> text file. For more information about using TXT files, see <a href="/vantage/documentation/advanced-designer/activities/flexilayout/user-dictionaries">User Dictionaries</a> and <a href="/vantage/documentation/advanced-designer/activities/extraction-rules/static-text">Static Text Element</a>.</p><p>To speed up the search, only the first <em>maxRecordsCount</em> variants are used (the default setting is 1000).</p><details><summary>E.g.</summary><pre><code>SearchTextFromFile: "Keywords.txt", 500;</code></pre></details></td></tr>
    <tr><td><p>Void SearchTextFromCatalog( String catalogParameterName, Int columnIndex, NamedValueArray searchCriteria = EmptyNamedValueArray, Int maxRecordsCount = 1000 )</p></td><td><p>Retrieves values from the column with index <em>columnIndex</em> in the data catalog referenced by the <em>catalogParameterName</em> parameter and uses these values as the set of strings to be searched on an image. You determine column indexes using one of the following global functions: FieldNamesOfCatalog, GetCatalogColumnIndex, GetCatalogColumnIndices.</p><p>The records may be filtered by the search criteria which are set using an array of named values, where each named value represents the column name and its expected value. The set of strings to find will contain only the values from the records which meet the search criteria.</p><details><summary>E.g.</summary><p>The code below tells the activity to search for values from the 2nd column of the data catalog referenced by the CompanyCatalog parameter:</p><pre><code>SearchTextFromCatalog( "CompanyCatalog", 2 );</code></pre><p>The code below filters the records based on the value of the "CompanyName" column. The value from the 2nd column will be added to the text to find only if the value of the "CompanyName" column for the corresponding record is "ABBYY".</p><pre><code>NamedValueArray searchCriteria = NamedValue( "CompanyName", "ABBYY" );<br />SearchTextFromCatalog( "CompanyCatalog", 2, searchCriteria );</code></pre><p>The code below uses an auxiliary method GetCatalogColumnIndex to get the column index by its name:</p><pre><code>SearchTextFromCatalog( "CompanyCatalog", GetCatalogColumnIndex( "CompanyCatalog", "ColumnName" ));</code></pre></details><p>To speed up the query, only the first <em>maxRecordsCount</em> records are accessed (the default setting is 1000).</p></td></tr>
    <tr><td><p>Void AllowIntersectPercent( Real )</p></td><td><p>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.</p></td></tr>
    <tr><td><p>Void SearchText( String )</p></td><td><p>Specifies the text that will be searched on an image. The string may contain several search variants separated with "|" (the OR operator). For more information, see <a href="/vantage/documentation/advanced-designer/activities/extraction-rules/static-text">Type-specific Properties of the Static Text Element</a>.</p></td></tr>
    <tr><td colspan="2"><p><em>The following methods are available if the text to find consists of several words</em></p></td></tr>
    <tr><td><p>Void NextLinePenalty( Real )</p></td><td><p>Sets a penalty for line breaks. The penalty is a number from 0 to 1. The quality of the hypothesis will be multiplied by this number as many times as there are line breaks in the phrase. If line breaks are allowed in the phrase, set this parameter to 1 (multiplying the quality of the hypothesis by 1 will not downgrade its quality).</p></td></tr>
    <tr><td><p>Void OmissionPenalty( Real )</p></td><td><p>Sets a penalty for missing words. The penalty is a number from 0 to 1. The quality of the hypothesis will be multiplied by this number as many times as there are missing words in the phrase. If some words may be absent in the phrase, set this parameter to 1 (multiplying the quality of the hypothesis by 1 will not downgrade its quality).</p></td></tr>
    <tr><td><p>Void WholeWordMode( Logic )</p></td><td><p>Specifies whether only whole text objects must be considered as valid hypotheses. When set to <strong>True</strong>, hypotheses consisting of parts of words are ignored. The default setting is <strong>False</strong>.</p><p><strong>Note.</strong> This method is different from <strong>AllowChoppedWords</strong> in that <strong>AllowChoppedWords</strong> affects only hypotheses generated from words on the boundary of the search area, whereas <strong>WholeWordMode</strong> affects the generation of all hypotheses.</p></td></tr>
    <tr><td><p>Void AllowEmbeddedHypotheses( Logic )</p></td><td><p>Sets the hypothesis formulation mode. To formulate all possible hypotheses (including overlapping and nested), set the value to <strong>True</strong>. To formulate hypotheses of maximum length, set to <strong>False</strong>.</p><details><summary>E.g.</summary><p>The code below tells the activity that it must formulate the longest hypothesis.</p><pre><code>AllowEmbeddedHypotheses(False);</code></pre></details></td></tr>
    <tr><td><p>Void MaxLineBreakDistance( Distance )</p></td><td><p>Sets the horizontal distance between the words on different lines if line breaks are allowed in the phrase.</p></td></tr>
    <tr><td><p>Void SuggestOnlySimilarChars( Logic value )</p></td><td><p>Specifies which characters the activity can use as replacement characters when performing a fuzzy search. When set to <strong>True</strong>, limits the activity to only using characters with a similar outline as replacement characters.</p></td></tr>
    <tr><td><p>Void AllowedTextRotations( TextRotations )</p></td><td><p>Specifies a set of allowed orientations for the recognized text. A hypothesis will only be formulated if the recognized text has an orientation that is allowed by this parameter.</p></td></tr>
  </tbody>
</table>
