TranscriptAligner

Lines a recogniser's output up with the text that was read, and says when each word of that text was spoken.

Not transcription: the words are known in advance, and the recogniser is only asked where they are. It gets some of them wrong, the more so the further the text is from what it was trained on, so words are paired by how alike they look on paper, and a word left unpaired has its time taken from the words around it.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun align(expected: List<String>, heard: List<RecognizedWord>, duration: Double, weighting: SpeechWeighting = EnglishSyllableWeighting(), equivalent: (String, String, String?) -> Boolean? = null): List<WordSpan>

One span per written word, in reading order.

Link copied to clipboard
fun pair(expected: List<String>, heard: List<String>, threshold: Double, equivalent: (String, String, String?) -> Boolean? = null): List<WordMatch>

Which written word came back as which heard word.