keenasr-web - v2.1.2
    Preparing search index...

    Type Alias AlignmentItem

    An individual item in an alignment trace, representing a single alignment operation.

    The trace shows how each token in the reference and recognized texts were aligned.

    for (const item of result.trace) {
    if (item.op === 0) { // MATCH
    console.log(`Matched: ${item.refToken}`);
    } else if (item.op === 1) { // SUBSTITUTION
    console.log(`Substituted: ${item.refToken} -> ${item.recToken}`);
    }
    }
    type AlignmentItem = {
        op: AlignOp;
        refIndex: number;
        recIndex: number;
        refToken: string;
        recToken: string;
    }
    Index

    Properties

    The alignment operation type. See AlignOp for values.

    refIndex: number

    Index of the token in the reference text (-1 for insertions)

    recIndex: number

    Index of the token in the recognized text (-1 for deletions)

    refToken: string

    The token from the reference text (empty for insertions)

    recToken: string

    The token from the recognized text (empty for deletions)