1. A computer-implemented 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, where each query stack and document stack comprises a plurality of scores, wherein the measure is a dot product measure defined as follows cos ⁡ ( q -> , d -> ) = q -> · d -> ( q -> · q -> ) ⁢ ⁢ ( d -> · d -> ) , where {right arrow over (q)} is a vector comprising scores from the query stack, and wherein {right arrow over (d)} is a vector comprising scores from the document stack.