Normalized reference tokens, in order. Indices in alignment results refer to positions in this array.
Language code this aligner was constructed with.
Whether the aligner has been closed.
StaticcreateCreate an aligner bound to the given reference and language code.
The reference is normalized and tokenized in native code at construction; the cached token vector is exposed via referenceTokens.
Reference text to align against.
ASR bundle language code (e.g. "en-us", "fr-fr").
Must match the ASR bundle that produced or will produce the recognized
text — normalization differs subtly between languages and a mismatch
silently degrades accuracy.
StaticcreateConvenience factory that sources the language code from the currently initialized recognizer's ASR bundle. The recognizer must be initialized before calling this.
Aligns recognized text against the reference. Stateless — safe to call concurrently with itself.
Recognized text from the ASR engine. null/empty
is treated as an empty string.
Optionalconfig: AlignmentConfigOptional per-call configuration. Defaults reproduce classic Levenshtein word edit distance with noise-token filtering on.
Aligns recognized text incrementally, reusing DP state from the previous call. Not thread-safe per aligner instance. Call reset between distinct utterances.
Optionalconfig: AlignmentConfigDrops cached DP state.
Release the native aligner. Subsequent calls on this instance throw. Safe to call more than once; later calls are no-ops.
Aligns recognized speech against a reference text using the native SDK's DP edit-distance aligner.
Typical use is oral-reading scoring: a user reads a known passage, the recognizer produces a hypothesis, and the aligner reports which reference words were read, which were skipped, and how far the reader got. The same primitive supports word-error-rate reporting for batch ASR evaluation.
alignrecomputes alignment from scratch on each call.incrementalAligncaches DP rows from the previous call and reuses them up to the longest common prefix of consecutive recognized inputs — useful when consuming a stream of partial ASR results against the same reference. Callreset()between distinct utterances.Always call close() when done to release the underlying native object promptly.
Example