# EntityRecognitionContext

Access to a logical text chain, its shared tokens and the candidate sink.

Class 

`OfficeIMO.Entities`

**Namespace**

`OfficeIMO.Entities`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[EntityRecognitionContext.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityRecognitionContext.cs#L58)

**Modifiers**

sealed

Access to a logical text chain, its shared tokens and the candidate sink.

## Inheritance

- object
- EntityRecognitionContext

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Accepted by parameters 1

- Method [IEntityRecognizer.Recognize](/api/core/officeimo-entities-ientityrecognizer/#method-recognize-officeimo-entities-entityrecognitioncontext) parameter `context`

Filter members 

Show inherited

## Methods

`public void Add(EntityCandidate candidate)` [#](#method-add-officeimo-entities-entitycandidate)

[EntityRecognitionContext.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityRecognitionContext.cs#L62)

Submits a valid reading within the searched logical text.

Parameters

**candidate OfficeIMO.Entities.EntityCandidate required**

`public IEnumerable<EntityToken> GetTokens(EntityTokenShape shapes)` [#](#method-gettokens-officeimo-entities-entitytokenshape)

Enumerates shared tokens that have any of the requested shapes.

Parameters

**shapes OfficeIMO.Entities.EntityTokenShape required**

Returns

`IEnumerable<EntityToken>`

`public bool IsEnabled(EntityScheme scheme)` [#](#method-isenabled-officeimo-entities-entityscheme)

[EntityRecognitionContext.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityRecognitionContext.cs#L58)

Reports whether the active finder options permit this scheme.

Parameters

**scheme OfficeIMO.Entities.EntityScheme required**

Returns

`bool`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Text { get; }` [#](#property-text)

[EntityRecognitionContext.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityRecognitionContext.cs#L40)

The searched logical text, with continued segments joined verbatim.

`public EntityTextSegment Segment { get; }` [#](#property-segment)

[EntityRecognitionContext.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityRecognitionContext.cs#L42)

Metadata from the first segment in the logical text.

`public int SegmentIndex { get; }` [#](#property-segmentindex)

[EntityRecognitionContext.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityRecognitionContext.cs#L44)

Zero-based index of the first segment in the logical text.

`public CancellationToken CancellationToken { get; }` [#](#property-cancellationtoken)

[EntityRecognitionContext.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Core/Entities/EntityRecognitionContext.cs#L46)

Cancellation token provided by the caller.

<!-- PowerForge markdown artifact sha256:A25AD22EC744D5D7303A2AD9CC775340A2C7C36A72AD8296F8F893F8CFD323B6 -->
