ContextCharsBeforeMatch

The number of UTF-8 characters to include in the context when Eduction sends a match to a Lua post-processing script.

When you configure context characters, Eduction sends matches to post-processing with additional context, which you can use in your custom post-processing scripts. For example, you might want to use additional context to judge the correctness of a match, or to augment a match with custom components when it satisfies certain criteria.

You configure the size of the context window by using ContextCharsBeforeMatch and ContextCharsAfterMatch. For performance reasons, Eduction uses an exact number of characters and does not attempt to break at a token or word boundary.

You retrieve the context in post-processing by using the getMatchContext Lua method.

NOTE: Context windows are compatible with pre-filtering.

In tables, context windows are restricted to the cell that contains the match.

Context windows are not compatible with repeated matches (that is, EdkGetNextRepeatedMatch is not supported when context is configured).

Type: Long
Default: 0
Required: No
Configuration Section:

Eduction

Example: ContextCharsBeforeMatch=100
See Also: TokenWithPunctuation