19. The computer program product of claim 15 , wherein the computer readable program when executed on the computer further causes the computer to: encode a plurality of electronic documents to corresponding one-dimensional structures; and store the plurality of electronic documents, the one-dimensional structures and associations between the plurality of electronic documents and the corresponding one-dimensional structures in the document storage.
15. A computer program product for retrieving an electronic document in response to receipt of an image patch comprising a non-transitory computer usable medium including a computer readable program, wherein the computer readable program when executed on a computer causes the computer to: receive the image patch; identify a first two-dimensional structure in the image patch; identify a second two-dimensional structure in the image patch; identify a third two-dimensional structure in the image patch; generate a first text string that encodes the first two-dimensional structure into a first one-dimensional structure by specifying a location of the first two-dimensional structure, a first quantized angle measured between a line originating from the first two-dimensional structure and a path joining a center of the first two-dimensional structure to a center of the second two-dimensional structure and a second quantized angle defining a path joining a center of the second two-dimensional structure to a center of the third two-dimensional structure; search, from a library, for a second one-dimensional structure that is similar to the first one-dimensional structure of the image patch; and retrieve the electronic document corresponding to the second one-dimensional structure similar to the first one-dimensional structure of the image patch from a document storage.