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

# Right-hand part

> Right-hand-part operations in NLP Extraction Rules code — create search elements, create groups, and create child search elements within groups.

<table>
  <thead>
    <tr><th>Operation</th><th>Syntax</th><th>Description</th><th>Example</th></tr>
  </thead>

  <tbody>
    <tr><td>create a search element</td><td><code>search\_element\_name( value\_expression )</code> <code>search\_element\_name( token\_variable1 + token\_variable2 )</code></td><td>The search element is assigned the value specified in the brackets. The value can be specified by a variable created in the left-hand part of the rule, or it can be passed directly as text in quotation marks. The values of several variables can be concatenated using the plus sign.</td><td><code>\[ t: "Contract" ] => kw\_Contract( t );</code> Assigns the value of the token t to the <code>kw\_Contract</code> search element. <code>\[ "Contract" | "Contrato" ] => documentType( "Contract" );</code> Sets the document type to a constant string "Contract" if the specified keywords were found. <code>\[ org1: @NEROrganization( same ) ]+ \[ kw\_doingBusinessAs: "d/b/a" | "d / b/ a" ] \[ org2: @NEROrganization( same )]+ => Supplier\_FullName( org1 + kw\_doingBusinessAs + org2 );</code> Finds two organization names joined by a "d/b/a" abbreviation and assigns the whole to the <code>Supplier\_FullName</code> search element.</td></tr>
    <tr><td>create a group</td><td><code>group\_name id</code></td><td>A new instance of a group is created and assigned to a variable. You can then use this variable to create nested search elements. <strong>Note:</strong> If you attempt to create a second instance of a non-repeating group, the whole rule will not be executed. When working with non-repeating groups, write two separate rules: for when an instance already exists and for when it does not.</td><td><code>\["Grantor"] \[":"] \[p: @NERPerson]+ => Grantor group, group.FullName( p );</code> Creates a new instance of a Grantor group and assigns the person's name found in the left-hand part to the <code>Grantor.FullName</code> search element.</td></tr>
    <tr><td>create a child search element in a group</td><td><code>id.search\_element\_name( value\_expression )</code></td><td>The new search element is created within the group specified by a variable and receives the value specified in the brackets.</td><td>See example above.</td></tr>
    <tr><td>create a child search element in a group from left-hand part</td><td><code>left\_hand\_part\_object.search\_element\_name( value\_expression )</code></td><td>The new search element is created within the group found in the left-hand part of the rule. The value for the new search element is specified in the brackets. <strong>Note:</strong> For a non-repeating groups, the left-hand part of your rule can both check that an instance exists and assign a variable name to that group. The right-hand part can then use this variable name to create nested elements.</td><td><code>group: Tenant \[p: @NERPerson]+ \[]\{0,3} \["Tenant"] => group.FullName( p );</code> Accesses the existing instance of a Tenant group and assigns the person's name found in the left-hand part to the <code>Tenant.FullName</code> search element. <code>\[org: @BuyerGroup.organization\_name]+ \[]\{3,9} \[addr: @NERAddress] => parent( obj( org ) ).buyer\_address( addr );</code> Finds an address named entity that is located close to the organization name and assigns this address to the <code>buyer\_address</code> search element in the same instance of BuyerGroup to which the <code>organization\_name</code> search element belongs.</td></tr>
  </tbody>
</table>
