Text structure recognition in optical reading