Pergunta de entrevista da empresa Microsoft

Write a function that counts words of a book based on type (noun, verb, etc)