The aim of this dissertation is to create a theory to model the factors, prominently, but not exclusively the phonological similarity, important in imperfect punning and to outline the implementation of this measure for the evaluation of possible imperfect puns given an input word and a set of possible target words. Imperfect, heterophonic, or paronomasic, puns differ from perfect, homophonic puns in that the target is different in sound from the pun. While homophonic puns are interesting for the linguist primarily with respect to their semantics, heterophonic puns present a research issue also to the phonologist, because they use one of two similar sound sequences to stand for both meanings associated with them, for example, bang to denote a noise as well as a financial institution. The specific question here is, how much contrast is possible between the pun and its target to make the latter recoverable, in terms of the semantics, phonology, and syntax of the pun-target pair and its context. The theoretical framework for the phonological part of this project is inspired by a recent version of Optimality Theory (OT), adopted in phonology, because it is able to describe the occurrence of related forms through a selection process from among possible candidate forms more appropriately than derivational approaches can by way of rules operating on one input form and yielding one output form. Taking more parameters—both phonological and syntactic—into account than previous studies, this project is intended to describe the linguistics of the imperfect pun in terms of a set of hierarchies of constraints weighing the differences found between the puns and targets of a sample corpus. Based on this measure, I will outline a computational implementation of the results that can evaluate an input word with respect to a set of existing English words from a machine-readable dictionary. The basic idea is to assign values to constraint violations and combinations thereof and then adding up the “penalty” for each violation in which a possible target does not conform to the pun