build word dictionary