Modeling the early-time spectra of core-collapse supernovae