1. A computer-readable recording medium that stores therein a logical structure analyzing computer program causing a computer to execute: extracting unit word candidates from character strings on a form including one or more headings and one or more data items; classifying each of the word candidates into a group of heading candidates for the headings or a group of data candidates for the data items to generate, based on positions of the word candidates on the form, first candidate sets each including one of the heading candidates and one of the data candidates identifiable by the heading candidate included; combining the first candidate sets to generate second candidate sets such that each includes a plurality of the heading candidates that differ and one of the data candidates; removing, from among the second candidate sets and for each of the data items, a determined set including a data item among the data items and the headings identifying the data item, the removing being based on positions, on the form, of the heading candidates and the data word candidate included in each of the second candidate sets; and outputting the determined set.