calculating lexical diversity