KeenASR React Native Plugin (v2.2)
    Preparing search index...

    Interface AlignmentResult

    Result of aligning a recognized token sequence against a reference.

    Exposes both an edit-script trace (suitable for word-error-rate reporting) and derived oral-reading views (matched / skipped / furthest-reached). Indices use -1 as the "no value" sentinel.

    interface AlignmentResult {
        trace: AlignmentItem[];
        matches: number;
        substitutions: number;
        insertions: number;
        deletions: number;
        refLength: number;
        recLength: number;
        wordErrorRate: number;
        matchedRefIndices: number[];
        skippedRefIndices: number[];
        furthestMatchedIndex: number;
        repetitionRefIndices: number[];
    }
    Index

    Properties

    trace: AlignmentItem[]

    Full alignment trace, left-to-right over the input sequences.

    matches: number

    Number of matched token pairs.

    substitutions: number

    Number of substitutions in the alignment.

    insertions: number

    Number of insertions (extra recognized tokens).

    deletions: number

    Number of deletions (skipped reference tokens).

    refLength: number

    Length of the post-normalization reference token vector.

    recLength: number

    Length of the post-normalization recognized token vector.

    wordErrorRate: number

    (substitutions + insertions + deletions) / refLength, or 0 when refLength == 0.

    matchedRefIndices: number[]

    Sorted reference indices that matched their corresponding recognized token. Substitutions and deletions are not counted — only exact matches.

    skippedRefIndices: number[]

    Sorted reference indices that did not match but lie at or below furthestMatchedIndex. Reference tokens past the furthest-matched index are treated as "not yet reached" and excluded.

    furthestMatchedIndex: number

    Highest matched reference index, or -1 if no reference token matched.

    repetitionRefIndices: number[]

    Reference indices flagged as repetitions in the recognized text. Populated only when AlignmentConfig.detectRepetitions was true on the call that produced this result.