The simplest way to deal with variable duration is to stretch the unknown word to have the same duration as the template.
Whole word templates
Our first automatic speech recogniser stores an example (“template”) of each word. Speech to be recognised is compared against each template.