1. A handwritten document processing apparatus comprising: an inputter that inputs stroke data; a classifier that classifies the stroke data into data of a plurality of ruled lines and stroke data other than ruled lines; a divider that divides a region including the plurality of ruled lines into first regions each corresponding to a cell bounded by four ruled lines and second regions each including at most three ruled lines; and a determiner that determines whether a ruled line in the second region is a first ruled line, to one end point of which a ruled line is not connected, or a second ruled line, to one end point of which a virtual circumscribed ruled line is connected.