1. A computer readable medium storing a computer program which when executed by at least one processor analyzes a document that comprises a plurality of words, each word comprising an associated set of glyphs, each glyph having location coordinates, the computer program comprising sets of instructions for: identifying a group of words based on the location coordinates of the glyphs; based on the identified cluster of words, defining a set of boundary elements for the glyphs; defining a structured document based on the glyphs and the defined set of boundary elements.