Optimal Deterministic Extractors for Generalized Santha-Vazirani Sources