A Probabilistic Framework for Lexicon-based Keyword Spotting in Handwritten Text Images