The short story is this: you need to first of all define what you mean by "实词token".
Once you get this you can have your corpus POS tagged, and on the basis of your POS
tagged corpus you can calculate your "实词tokens" by searching the POS tags that
you think belong to the "实词tokens". And then you can calculate 词汇密度 based on
your formula.
There was a discussion about this a while ago...I think it's here: