Determining Dark-Matter-Electron Scattering Rates from the Dielectric Function.