Theoretical analysis of hydrogen bonds in carbohydrate crystals