Recent advances in computer-assisted content analysis have made available to historians and social scientists much richer and more flexible historical records from textual sources (e.g., archives, newspapers). These records are organized in complex data structures (namely, separate but interconnected files). Furthermore, the content of these records is mostly words. This paper shows how narrative data organized in complex data structures can be analyzed statistically. It also shows that powerful linguistic schemes for content analysis (namely, semantic grammars) can be reexpressed as set theoretical problems. Set theory also provides the mathematical foundation for the relational data model that can be used to store text data collected via a semantic grammar. Finally, set theory provides the basic tools (namely, the cardinal number) necessary to go "from words to numbers." It is this basic transformation that allows researchers to perform general kinds of quantitative analyses on such qualitative data as words.