Voting Rules As Error-Correcting Codes