align

fun align(reference: String, heard: List<TranscriptToken>, lowConfidenceThreshold: Float = DEFAULT_LOW_CONFIDENCE_THRESHOLD, locale: Locale = Locale.US): TranscriptAlignment

Aligns heard words against a reference text.

Parameters

reference

The text the speaker was asked to say.

heard

The words the recognizer heard, in order.

lowConfidenceThreshold

Matched words whose confidence is below this become AlignedTokenStatus.LowConfidence. Words without a confidence are never low.

locale

The locale used for case folding.


fun align(reference: String, heard: String, locale: Locale = Locale.US): TranscriptAlignment

Aligns a plain heard transcript, with no confidences, against a reference text.

Parameters

reference

The text the speaker was asked to say.

heard

The recognized text.

locale

The locale used for case folding.