1. A computer-implemented method comprising: receiving a query having an original term; determining a plurality of substitution contexts for the original term, wherein each substitution context includes one or more context terms, and wherein, when the substitution context is associated with a substitute term, the substitution context specifies substituting the original term with the substitute term in the query if and only if the one or more context terms occur in the query at a position relative to the original term specified by the substitution context; computing respective scores for each first substitution context of the plurality of substitution contexts for the original term including: generating a first alternate set comprising terms that each occur at least once in a textual collection at a position specified by the first substitution context, the position being relative to one or more context terms of the first substitution context, computing respective first rates for each first term in the first alternate set, each first rate for a first term representing (i) how often the first term occurs in the textual collection at the position specified by the first substitution context compared to (ii) how often the original term occurs in the textual collection at the position specified by the first substitution context, generating a second alternate set comprising terms that each occur at least once in a textual collection at a position specified by a different second substitution context of the plurality of substitution contexts for the original term, the position being relative to one or more context terms of the second substitution context, computing respective second rates for each second term in the second alternate set, each second rate for a second term representing (i) how often the second term occurs in the textual collection at the position specified by the second substitution context compared to (ii) how often the original term occurs in the textual collection at the position specified by the first substitution context, computing an alternate set difference between the first alternate set and the second alternate set, the alternate set difference representing a measure of divergence between the computed first rates for the first alternate set and the computed second rates for the second alternate set, and computing the score for the first substitution context relative to the second substitution context based on the alternate set difference between the first alternate set and the second alternate set; classifying each of the plurality of substitution contexts into a first category or a second category based on the respective score computed for each substitution context; associating the original term with one or more substitution contexts in the first category; and providing only substitution contexts in the first category to a substitute term generation process that generates substitute terms for the original term in the query.