KeenASR Framework v2.2 (c662ac9)
Keen Research
Loading...
Searching...
No Matches
KIOSAlignmentResult Class Reference

Result of aligning a recognized token sequence against a reference. More...

#include <KIOSTextAligner.h>

Properties

NSArray< KIOSAlignmentItem * > * trace
 Full alignment trace, left-to-right over the input sequences.
NSInteger matches
 Number of matched token pairs.
NSInteger substitutions
 Number of substitutions in the alignment.
NSInteger insertions
 Number of insertions (extra recognized tokens).
NSInteger deletions
 Number of deletions (skipped reference tokens).
NSInteger refLength
 Length of the post-normalization reference token vector.
NSInteger recLength
 Length of the post-normalization recognized token vector.
float wordErrorRate
 Word error rate: (substitutions + insertions + deletions) / refLength.
NSArray< NSNumber * > * matchedRefIndices
 Sorted array of reference indices that matched their corresponding recognized token (NSNumber-wrapped NSInteger).
NSArray< NSNumber * > * skippedRefIndices
 Sorted array of reference indices that did not match but lie at or below furthestMatchedIndex (NSNumber-wrapped NSInteger).
NSInteger furthestMatchedIndex
 Highest matched reference index, or NSNotFound if no reference token matched.
NSArray< NSNumber * > * repetitionRefIndices
 Reference indices flagged as repetitions in the recognized text (NSNumber-wrapped NSInteger).

Detailed Description

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 in all *RefIndices accessors and furthestMatchedIndex refer to positions in the normalized reference token vector, accessible via KIOSTextAligner.referenceTokens.

Property Documentation

◆ matchedRefIndices

- (NSArray<NSNumber *>*) matchedRefIndices
readnonatomicassign

Sorted array of reference indices that matched their corresponding recognized token (NSNumber-wrapped NSInteger).

Substitutions and deletions are not counted as matched on the reference side — only exact-word matches.

◆ repetitionRefIndices

- (NSArray<NSNumber *>*) repetitionRefIndices
readnonatomicassign

Reference indices flagged as repetitions in the recognized text (NSNumber-wrapped NSInteger).

Populated only when KIOSAlignmentConfig.detectRepetitions was YES on the call that produced this result. Empty otherwise.

◆ skippedRefIndices

- (NSArray<NSNumber *>*) skippedRefIndices
readnonatomicassign

Sorted array of reference indices that did not match but lie at or below furthestMatchedIndex (NSNumber-wrapped NSInteger).

Reference tokens past the furthest-matched index are treated as "not yet reached" rather than skipped, and are excluded here. Useful for read-along UIs that highlight skipped words.

◆ wordErrorRate

- (float) wordErrorRate
readnonatomicassign

Word error rate: (substitutions + insertions + deletions) / refLength.

Returns 0.0 when refLength is 0.


The documentation for this class was generated from the following file: