An $\mathbf{L^*}$ Algorithm for Deterministic Weighted Regular Languages