1. A method comprising the steps of: creating a document stack from at least one word in a handwritten document; creating a query stack from a query; and determining a measure between the document stack and the query stack.