1. A method for determining a logical structure of a document, comprising: generating at least one document hypothesis for the whole document; for each document hypothesis, verifying said document hypothesis including (a) generating at least one block hypothesis for each block in the document based on the document hypothesis; (b) selecting a best block hypothesis for each block; selecting as a best document hypothesis the document hypothesis that has the best degree of correspondence with the selected best block hypotheses for the document; and forming the document based on the best document hypothesis.