1. A system comprising: one or more computers including one or more storage devices storing instructions that when executed by the one or more computers cause the one or more computers to perform operations comprising: receiving a query comprising three or more terms; identifying, from among the terms of the query, an entity name and two or more context terms; obtaining a plurality of candidate corrected spellings for the entity name; determining a respective count of co-occurrences of each context term with each candidate corrected spelling for the entity name, in a plurality of texts comprising: counting, as one co-occurrence, each distinct text from the plurality of texts in which the context term and the candidate corrected spelling both appear at least once; or counting, as one co-occurrence, each distinct window of text from the plurality of texts in which the context term and the candidate corrected spelling both appear at least once; determining a score for each candidate corrected spelling for the entity name based at least on the respective counts of co-occurrences of each context term with the respective candidate corrected spelling for the entity name, in the plurality of texts; selecting one or more of the candidate corrected spellings for the entity name based at least on the scores; and using the selected one or more candidate corrected spellings to generate a response to the query.