  We present a method for the enumeration of restricted words over a finite
alphabet. Restrictions are described through the inclusion or exclusion of
suitable building blocks used to construct the words by concatenation. Our
approach, which relies on the invert transform and its representation in terms
of partial Bell polynomials, allows us to generalize and address in a
systematic manner previous results in the subject.
