AlvisNLP

corpus processing engine

Assert

Synopsis

Tests an assertion on specified elements.

Description

Assert evaluates target as a list of elements. Then, for each element, evaluates assertion as a boolean. Assert reports each element for which assertion is false . Assert aborts the processing of the corpus if severe is true .

Snippet

<assert class="Assert">
    <assertion></assertion>
    <target></target>
</assert>

Mandatory parameters

assertion

Mandatory
Type: Expression

Expression evaluated as a boolean with the target element as the context element. This parameter specifies the assertion to be checked on each target.

target

Mandatory
Type: Expression

Expression evaluated as a list of elements with the corpus as the context element. This parameter specifies the elements on which the assertion is checked.

Optional parameters

message

Optional
Type: Expression

Customize the assertion failure message. This expression is evaluated as a string from the failed target.

outFile

Optional

Path to the file where to record assertion failures. If not set then assertion failures are not recorded, and only displayed on the log.

stopAt

Optional
Type: Integer

Maximum number of assertion failures before Assert will stop checking.

severe

Default value: `true`
Type: Boolean

If true and there is at least one assertion failure, then Assert will abort the processing of the corpus.

Deprecated parameters