text.hpp: initial support for generating a word stream from a document