1. A document structure analysis device comprising: retrieving means for retrieving sample data including codes representing characters; signalizing means for converting the codes for each character of the retrieved sample data into n-value respectively in a data format of P rows*Q columns, where n is a natural number greater than or equal to 2; storing means for storing the sample data with n-value converted by the signalizing means; calculating means for calculating a degree of similarity based on overlaps between the sample data and an input data by comparing the sample data stored in the storing means with the input data by computing operation, the input data representing characters and converted into n-value in the data format of P rows*Q columns by the signalizing means; and classifying means for classifying the input data based on the calculated degree of similarity, wherein the retrieving means identifies the sample data or the input data.